convert .htm to .pdf

Joined
Mar 4, 2013
Messages
2
Reaction score
0
Points
1
I'm running a simulation. After the simulation runs, I have a line of code to convert the .htm output into a .pdf file (see example 1). The command works but the .pdf file is poorly formatted. Parts of the top and bottom and all of the right hand side are missing and file doesn't start each graph on a new page.

I had a command line that used to work in Lion (see example 2) but it doesn't work in Mountain Lion (see error msg for example 2).

Example 1: command works but .pdf not formatted
/usr/sbin/cupsfilter -f "`htm_loc_file'.htm" -a landscape -o "`htm_loc_file'.pdf"

Example 2: command and error message (Mountain Lion)
/System/Library/Printers/Libraries/convert -f "`htm_loc_file'.htm" -a landscape -o "`htm_loc_file'.pdf"

Error msg
/bin/bash: /System/Library/Printers/Libraries/convert: No such file or directory
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Just looked in /System/Library/Printers/Libraries and there is no convert file. On my wife's Snow Leopard it's there (actually a symlink) and points to /usr/sbin/cupsfilter which is also not in Mountain Lion.
Might have to find another way.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I've obviously installed something along the way because I have cupsfilter installed. Unfortunately, I have no idea where cupsfilter came from since I had imagined that it simply came with CUPS (evidently not).

So, it is possible to have cupsfilter but where it comes from is a mystery to me. I'll see if I can find this.
 
OP
S
Joined
Mar 4, 2013
Messages
2
Reaction score
0
Points
1
Thanks for the quick responses! The command line -- /usr/sbin/cupsfilter -f "`htm_loc_file'.htm" -a landscape -o "`htm_loc_file'.pdf" -- works on my version of Mountain Lion and it does convert an .htm file to a .pdf.

The problem is the formatting on the .pdf. Any thoughts?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top