Seldaek / slippy

HTML Presentations
815 stars 89 forks source link

PhantomJS-rendered PDFs are entirely raster, including the text #6

Closed orospakr closed 13 years ago

orospakr commented 13 years ago

Normally when I print to PDF from a webkit-based browser, I get a PDF with text that will zoom to any size, and is selectable.

Seldaek commented 13 years ago

I'm aware of the issue, but I haven't had time to figure out how to fix it yet :/ That's why it is rasterized in high resolution, so it scales decently everywhere. But yeah, it'd be great to have text selection and especially keep links active.

If you feel like helping out feel free, I'm unable to spend time on this at the moment.

orospakr commented 13 years ago

Duly noted. I figured as much. ;)

Seldaek commented 13 years ago

Eh well, seems like I didn't feel like working today..

Fixed in 4a2a570a20372743cb0e1102174225bf56d27507. Please verify it works for you, because I had weird issues with the viewport size.

The size went down 10x, text is selectable, and links are made clickable by my pdf viewer if they have http:// in front, but anchors with arbitrary text aren't (I nagged the PhantomJS guys, we'll see).

abecks commented 9 years ago

@Seldaek What about that commit skips the rasterization process in PhantomJS? I can't find any documentation on it anywhere. Is it because you are setting paperSize?

Im having a similar issue using node-webshot, which wraps PhantomJS. All of the PDFs I generate are fully rasterized without selectable text.

Seldaek commented 9 years ago

@abecks my problem IIRC was that I output all pages to png first and then combined them into a pdf, and the fix was to output pdfs only and then glue them together as one pdf using pdftk. Good luck :/