-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Running the pdf example produces a pdf with no selectable text #10373
Comments
m...@thomasbachem.com commented:
|
m...@thomasbachem.com commented:
|
veen...@gmail.com commented:
|
adkison....@gmail.com commented:
|
david.hi...@pulseenergy.com commented:
|
andin...@gmail.com commented:
|
andin...@gmail.com commented:
|
using an old version of wkhtmltopdf seems to work (like this one) http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-OSX-0.10.0_rc2-static.tar.bz2 |
I can also confirm that running phantomjs 1.8.2 on OSX 10.8.5 results in text not being selectable and links not clickable. |
OSX 10.7.5 here, same issue. |
There is a pull request for a fix here: #11509 |
Produces selectable text when printing/rasterizing to PDF on OSX. ariya#10373
any progress on this? |
I guess this will be fixed in version phantomjs v2. |
Backing up @andi-neck - definitely an OSX issue. Identical NPM/phantomjs versions show this working on Linux (Ubuntu 14.04), but not on OSX (Yosemite). |
I'm running 2.0.0 (development) on linux and I'm seeing the issue. While trying to render an svg containing embedded fonts all the text is rasterized (it looks correct, but it isn't text). |
I experience the same issue same code runs great on windows 8, except, the viewport seems to be better respected on my windows box and the text just is not selectable. |
What is the resolution for this? Is it confirmed that it works on Linux but not Mac? |
It's not working on Linux for me (2.0.0). I discovered that as long as you don't embed the fonts in the SVG they render as text. I guess you need to have them registered and available within the system but that gets into some Linux font madness that I couldn't quite figure out. I was trying to take my embedded fonts, strip them from the SVG, register them temporarily as system fonts, render the PDF, then deregister the fonts again. I think there's a work around there - hopefully someone who knows a little more about font management in Linux knows how to make this pattern work. |
I confirm this bug too using phantomjs 2 in Ubuntu 14.04 |
confirmed that this issue is still present with 2.0 on Mac OS 10.10.2. Rendering a PDF results in text being rasterized and not selectable. |
Hey Folks, is there any version of phantomjs where text seems to be selectable on MacOSX. I have 1.9.0 on linux box and the resultant pdf has non selectable text. This is turning out to be a deal breaker for me. |
…n QCoreTextFontEngine Fix bugs generating PDF on Cocoa Provide real implementations of: properties(), faceId() and getUnscaledGlyph Task-number: QTBUG-10094 ariya#10373
…n QCoreTextFontEngine Fix bugs generating PDF on Cocoa Provide real implementations of: properties(), faceId() and getUnscaledGlyph Task-number: QTBUG-10094 ariya#10373
I can confirm this is happening when building PhantomJS 2.0.0 from source on CentOS 6 |
+1 same issue |
+1 with PhantomJS 2.0.0 on Mac. Any workarounds? |
+1 Same issue |
Given the externalisation of Qt Base as a submodule, PR #13243 is superseded by vitallium/qtbase#2. |
@astefanutti do you have instructions on how this pull request could be tested. I am interested in doing the test just need proper instructions. |
@anantshri just rebuild PhantomJS with vitallium/qtbase#2 on Mac OS and run the usual |
@astefanutti does that also include hyperlink support (#10196)? Given the warning in the compilation instructions (http://phantomjs.org/build.html), any chance you would mind posting a compiled binary for Mac OS? Thanks a ton for your fixes! |
@travis5555 you can get a Mac OS binary from here: https://github.com/astefanutti/decktape#install. It contains hyperlink support as well. |
thanks for the quick reply @astefanutti! I hadn't seen decktape before - it looks pretty awesome. since it has all of the awesomeness of embedded text, hyperlink, support, etc, is there any reason it can't be used for generic HTML > PDF conversion as opposed to slide decks specifically? |
@travis5555 you're right. DeckTape depends on the improved version of PhantomJS that I maintain here https://github.com/astefanutti/phantomjs and that can be used for general purpose HTML to PDF conversion. Ideally, all the improvements will be integrated in PhantomJS upstream so that DeckTape value remains for slide decks specifically. |
@astefanutti how do I |
Some progress related to that issue can be found at #13997 (mostly Linux). |
+1 same issue. Any workaround to fix this? |
Wanted to post my solution to this problem. It turns out that loading a web font from a remote URL will cause PhantomJS to rasterize the font in the PDF. This creates a PDF where the text cannot be highlighted, since it is an image. This causes the PDF file size to grow 10 times. We were using Proxima Nova, and our CSS file looked like this:
To fix the issue, we installed the Proxima Nova TTF files directly onto our Ubuntu box. This means copying the TTF files to Now we can change our CSS to just the following:
PhantomJS now treats Proxima Nova as a natively installed font, and renders a smaller sized PDF with selectable text. This is the right solution. Note: I only encountered this problem on Linux. Mac OS worked fine. |
@robinfhu I was going to try your solution and realised that upgrading my dependencies was enough. I think there was a bug, and it got fixed at some point. Regardless of that, the case you found is a very good one to know. FWIW, I'm using phantomjs indirectly via https://www.npmjs.com/package/markdown-pdf. |
1.9.8 works for me on Centos7. 2.1.1 rasterizes the output |
@robinfhu your solution works for me. I installed the font used in my pdf to the machine. Now the pdf output is as normal as the output in my Mac. But the thing is I need to run some pdf render test in the CI with Ubuntu OS. I don't want to install font before run the test, and that is not a good solution. Maybe with some fix the linux version of Phantomjs can fix this issue. I am still watching this, if there are any updates. |
Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be closed. In the future, if we see the need to attend to this issue again, then it will be reopened. |
bla...@gmail.com commented:
Disclaimer:
This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #373.
🌟 14 people had starred this issue at the time of migration.
The text was updated successfully, but these errors were encountered: