plessl / wkpdf

A command line HTML to PDF converter for Mac OS X
http://plessl.github.com/wkpdf
MIT License
184 stars 24 forks source link

wkpdf fails on OS X 10.5 with undefined method `pageSizeForPaper' for nil:NilClass (NoMethodError) #11

Closed plessl closed 14 years ago

plessl commented 14 years ago

This problem is causes by a recent change to improve the compatibility with SnowLeopard.

Fixing this problem should be pretty easy by storing a table of paper format names and corresponding page sizes in wkpdf.

plessl commented 14 years ago

Below is a list of paper names and sizes as used by ghostview.

What remains to do is to change the method parsePaperSize in lib/commandline_parser.rb to use the values from the list below, instead of querying the printer object. I think this is even a better solution than querying NSPrinter.printerWithType("Generic PostScript Printer") because I don't know, whether this printer is available on all systems.

Letter 612x792 LetterSmall 612x792 Tabloid 792x1224 Ledger 1224x792 Legal 612x1008 Statement 396x612 Executive 540x720 A0 2384x3371 A1 1685x2384 A2 1190x1684 A3 842x1190 A4 595x842 A4Small 595x842 A5 420x595 B4 729x1032 B5 516x729 Envelope ???x??? Folio 612x936 Quarto 610x780 10x14 720x1008

plessl commented 14 years ago

This problem has been fixed in commit 66439f631d61 which is available in wkpdf-0.3.8. Now wkpdf should be compatible again with OS X 10.5.