How to integrate html2ps with ImageMagick

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
edlozano

How to integrate html2ps with ImageMagick

Post by edlozano »

I have html2ps installed and working, but I can not get ImageMagick to delegate html conversions to html2ps. How can I make ImageMagick aware of html2ps?

I am running ImageMagick-6.6.1-3-Q16 on Windows 7. I have installed ActivePerl 5.10.1.1007. I checked the "Install PerlMagick" check box when installing ImageMagick. I have installed Ghostscript 8.64. I have set my system PATH variable to point to the Ghostscript, ImageMagick, and Perl directories. I ran the html2ps-1.0b6 install script which detects ImageMagick, GhostScript, and UserAgent.pm; the html2ps install script does NOT detect Image\Magick.pm. I have edited the @html2ps and set PerlMagick to 1. I can invoke conversions on html2ps using the command "perl html2ps file.html > file.ps".

Thanks for any help!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: How to integrate html2ps with ImageMagick

Post by magick »

Post the output of this command:
  • convert -verbose index.html index.png
It will help us debug the problem.
edlozano

Re: How to integrate html2ps with ImageMagick

Post by edlozano »

>convert -verbose index.html index.png
html2ps -U -o "C:/Users/ETHANL~1/AppData/Local/Temp/magick-iCMZDbRn" "C:/Users/ETHANL~1/AppData/Local/Temp/magick-x5lOSkc5"
convert: `%s' (%d) html2ps -U -o "C:/Users/ETHANL~1/AppData/Local/Temp/magick-iCMZDbRn" "C:/Users/ETHANL~1/AppData/Local/Temp/magick-x5lOSkc5" @ error/utility.c/SystemCommand/1982.
convert: delegate failed `html2ps -U -o "%o" "%i"' @ error/delegate.c/InvokeDelegate/1061.
convert: unable to open image `C:/Users/ETHANL~1/AppData/Local/Temp/magick-x3W6SbNE': No such file or directory @ error/blob.c/OpenBlob/2489.
convert: unable to open file `C:/Users/ETHANL~1/AppData/Local/Temp/magick-x3W6SbNE': No such file or directory @ error/constitute.c/ReadImage/572.
convert: missing an image filename `index.png' @ error/convert.c/ConvertImageCommand/2970.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: How to integrate html2ps with ImageMagick

Post by magick »

We verified html2ps works under Linux. You can try editing html2ps and add the path of perl as the first line of the script. Otherwise try editing delegates.xml and change 'html2ps' to 'perl html2ps' and let us know if that fixes the problem.
edlozano

Re: How to integrate html2ps with ImageMagick

Post by edlozano »

The html2ps file seems to already have perl as the first line:

: # Use perl
eval 'exec C:\Perl64\bin\perl.exe -S $0 "$@"'

Altering the delegates.xml file seems the most promising. However, i should have mentioned that I have never been able to run the command: 'perl html2ps -u -o index.ps index.html'. I have always had to point to the html2ps script as follows: 'perl "C:\Program Files (x86)\html2ps\bin\html2ps" -u -o index.ps index.html'. What settings would I have to alter to avoid specifying the path to the script? I tried adding the following in the delegates.xml file:

<delegate decode="html" command="perl "C:\Program Files (x86)\html2ps\bin\html2ps" -U -o "%o" "%i""/>

but get the following error:
>convert index.html index.png
Can't open perl script "C:Program": No such file or directory
convert: delegate failed `perl "C:\Program Files (x86)\html2ps\bin\html2ps" -U -o "%o" "%i"' @ error/delegate.c/InvokeDelegate/1061.
convert: unable to open image `C:/Users/ETHANL~1/AppData/Local/Temp/magick-dB3g0ine': No such file or directory @ error/blob.c/OpenBlob/2489.
convert: unable to open file `C:/Users/ETHANL~1/AppData/Local/Temp/magick-dB3g0ine': No such file or directory @ error/constitute.c/ReadImage/572.
convert: missing an image filename `index.png' @ error/convert.c/ConvertImageCommand/2970.

I have also experimented with \\ for backslashes and &nbsp; for spaces, but have not had any success.
Post Reply