Install pdf2htmlEX on heroku - ruby-on-rails

I used this Aptfile:
fonts-liberation
libreoffice-base-core
libreoffice-calc
libreoffice-writer
libreoffice
libpython2.7
pdf2htmlex
poppler-utils
And installation completed successfully. I even checked version of pdf2htmlEX in heroku bash.
pdf2htmlEX --version
pdf2htmlEX version 0.14.6
Copyright 2012-2015 Lu Wang <coolwanglu#gmail.com> and other contributors
Libraries:
poppler 0.41.0
libfontforge 20120731
Default data-dir: /usr/share/pdf2htmlEX
Supported image format: png jpg
But when I try to convert real PDF documents I'm getting this error:
Error: Cannot open the manifest file
I found on other sites that I need to run "make install" to fix this issue but not sure if it's possible with heroku.
Any help will be appreciated. Thanks

Similar answer on pdf2htmlEX
On heroki-18 I faced similar issue and resolved it by passing data-dir while converting.
If you are ruby you can use Kristin gem with master branch

look at this:
https://github.com/coolwanglu/pdf2htmlEX/issues/749
you just need to add the optional parameter --data-dir C:\<pdf2htmlex-folder>\data
to the command

Related

ros tuetlebot3 launh file

bug
I am using ubuntu version 20.0.4
I have followed all the turtlebot simulation instruction here but don't what is the issue I also check my bashrc file all the path are correct. Can anyone help me
Update by bashrc file
Run the turtlebot launch file
You're running 20.04, which means your ROS version will be Noetic. However the tutorial you're referencing is written for Kinetic; which means you're installing a package for the wrong version.
You can either repeat the install instructions with: git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git. Or cd into the cloned package and checkout the right branch via: git checkout noetic-devel.
Note that you'll most likely need to clean your workspace as it will not have built right.

How to install mupdf on heroku?

I've upgraded to rails 5.2 and am implementing ActiveStorage. ActiveStorage uses mutool for PDF processing. I have successfully installed mutool locally using homebrew.
mutool is a bit confusing.
rails docs claim to require "mutool",
homebrew installs "mupdf-tools",
and heroku wants "mupdf".
I have successfully installed apt and mupdf on heroku following these steps:
- add a new Aptfile to the root of my application with only "mupdf" listed
- commit and push the Aptfile
- THEN run heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt
- push again so heroku will finish installing apt and mupdf
mupdf builds successful during the push
heroku buildpacks now returns
1. https://github.com/heroku/heroku-buildpack-apt
2. heroku/ruby
If I refresh a page calling for a variant on a PDF, the image fails to process and the job kicks back the following error:
Errno::ENOENT: No such file or directory - mutool
It seems mutool and mupdf are synonomous...so, I tried swapping out mutool for mupdf in my Aptfile...that failed to build from "...not found'.
Anyone know what action I need to take?
PS: This is part of implementing rails 5.2 using ActiveStorage.
UPDATE
I added mupdf-tools to Aptfile and that seems to fix the "no such file or directory" error. I don't know for sure because a new errors surfaces
MiniMagick::Invalid: `identify /tmp/mini_magick20180105-4-pvub9r` failed with error: identify.im6: no decode delegate for this image format `/tmp/mini_magick20180105-4-pvub9r' # error/constitute.c/ReadImage/544.
MiniMagick::Error: `identify -format %m %w %h %b /tmp/ActiveStorage20180105-4-1f46tem[0]` failed with error: identify.im6: no decode delegate for this image format `/tmp/ActiveStorage20180105-4-1f46tem' # error/constitute.c/ReadImage/544.
Heroku recommends Poppler as an alternative to MuPDF for licensing reasons (MuPDF has a commercial license).
They created a buildpack for Active Storage Previews that covers PDFs as well as Video files.
I know this is a bit old, but if you're still having this issue I was able to resolve this by updating the version of mupdf-tools to at least 1.8.
To do this with Heroku, you'll want to link directly to the latest release.
Add heroku-buildpack-apt, and then add a custom Aptfile. Note that you'll need to add the Aptfile first in order for the buildpack to work.
Here is what my Aptfile looks like:
:repo:deb http://archive.ubuntu.com/ubuntu artful main universe
imagemagick
ffmpeg
mupdf-tools
To test that you have the right version, you can use heroku ps:exec to test. Run mutool -v and you should be on version 1.11.

ImageMagick Needs a Dependency That Doesn't Exist?

In attempting to install the latest ImageMagick (and devel) RPM from http://www.imagemagick.org/download/linux/CentOS/x86_64/ I receive this message
ImageMagick-libs = 6.8.5-8 is needed by ImageMagick-devel-6.8.5-8.x86_64
Confusingly, there is no ImageMagick-libs RPM listed, and searching has yet to yield a solution. Is there a way around this existential dependency?
Neither I nor Google know where ImageMagick-libs lives nor what it contains, but for posterity this gets things up and running on CentOS 5.8 (the distribution listed on imagemagick.org):
>: rpm -Uvh --nodeps ImageMagick-6.8.5-8.x86_64.rpm ImageMagick-devel-6.8.5-8.x86_64.rpm
>: ln -s /usr/include/ImageMagick-6 /usr/include/ImageMagick
The symbolic link was necessary for software relying on ImageMagick header files.
If someone were to stumble upon this, the ImageMagick-libs RPM are now downloadable from the link in the question.
I ran into the same thing when building the RPMs myself.
line 66 of the SRPM's included ImageMagick spec file includes:
Requires: %{name}-libs = %{version}-%{release}
I just commented out that line and the build completes; the resultant RPM satisfies the requirement cleaner. In sum, I believe it a bug in the SPEC file bundled in the SRPM. It isn't necessary for functionality even when building against php magickwand and similar finicky tools that require headers from ImageMagick.

Install binary dependencies on Heroku

I need to convert PDF to PNG on heroku, i'm using RMagick and for some PDF i run into this error :
Ghostscript 8.628.62: : Unrecoverable error, exit code 1 Unrecoverable
The same code runs fine on my local machine using Ghostscript 9.05
I would like to update the version of Ghostscript being used on Heroku and see if that solves the problem.
I followed these instruction to build ghostscript 9.05 on heroku :
http://theprogrammingbutler.com/blog/archives/2011/07/28/running-pdftotext-on-heroku/
My problem is vendoring the resulting package, how can i tell heroku to use my custom version of ghostscript instead of the system one ?
Here is what i tried :
Add the gs package under vendor/ghostscript/bin
Add it to the heroku path : heroku config:add PATH=vendor/ghostscript/bin:/usr/bin:/bin
My app still run on GS 8.62
Any help would be greatly appreciated !
Here are some ressources i tried to follow without success ...
https://devcenter.heroku.com/articles/buildpack-binaries
http://www.ryandaigle.com/a/using-vulcan-to-build-binary-dependencies-on-heroku

Paperclip error

I am getting the following error when uploading an image on the admin panel of spree (RoR e-commerce platform):
Paperclip::NotIdentifiedByImageMagickError in Admin/imagesController#create
/tmp/stream.4724.0 is not recognized by the 'identify' command.
Any ideas? Thanks.
It sounds like the wrong identify command (which is part of ImageMagick) is being called (or, perhaps, it isn't installed at all). Can you confirm the path to this command on your server using:
which identify
Once you've determined where this command is installed (e.g. /usr/local/bin) then you can tell Paperclip about it by adding the following to your environment.rb (or production.rb etc) file:
Paperclip.options[:command_path] = '/usr/local/bin/'
(this is for Paperclip 2.2 and above. If you're using an earlier version you should use :image_magick_path not :command_path)
I solved this problem by
$ sudo apt-get install imagemagick
I'm not saying this is the solution but it wouldn't hurt to check your file permissions. Can the user running imagemagick access files in /tmp/ ?

Resources