Is there a way to disable auto generated hyperlinks from pdf. For example, I have a string https://example.com/, after converting from html to pdf using Puppeteer, it automatically converts the string to an hyperlink, which does not exist.
Is there a flag or something in Chromium or puppeteer to disable auto linkification.
Puppeteer does not add any links to the PDF document that are not actually present in the page. It is very likely your PDF viewer that is adding these links.
Try it yourself.
Upload your PDF to this viewer (that uses PDF.js), button is in the top right. This viewer does not add any links to the document. If the link is not clickable in this document, your PDF viewer is adding the links.
Related
I am trying to generate a PDF (as an A4 page) from a specific div in my HTML page along with it's style. Is there a way to do that without using addStyleTag? There is a lot of style and addStyleTag simply won't work.
Thank you.
I have seen webpage with a PDF icon, where you could click on it to print the content of that webpage.
The page i am intending to add the print feature is designed in JSF, so is there anyway where i could add a print button, to get the webpage printed ?
No, you must do this yourself. Get some PDF library (for example iText), then get web page output (plain HTML). Then you will have to iterate thru HTML and create PDF version (for example build iText document). You will probably have to do this yourself, because some elements (javascript powered) will need to turn into static content. Nobody but you knows how the output should look like.
https://spreadsheets.google.com/spreadsheet/pub?key=0Ap6NKDUcJz8sdHZjOWM1bkFxZ0wxUW9Bcnl3QmRsbGc&single=true&gid=0&output=pdf
The link above downloads the PDF, but I just want it to open up in the browser. Is there a way to do this?
Remove the output=pdf.
https://spreadsheets.google.com/spreadsheet/pub?key=0Ap6NKDUcJz8sdHZjOWM1bkFxZ0wxUW9Bcnl3QmRsbGc&single=true&gid=0
If you want to open pdf in browser without downloading pdf then below is the best way to do it :
Intent i = new Intent(Intent.ACTION_VIEW);
String yoururl = https://spreadsheets.google.com/spreadsheet/pub?key=0Ap6NKDUcJz8sdHZjOWM1bkFxZ0wxUW9Bcnl3QmRsbGc&single=true&gid=0&output=pdf;
yoururl= "https://drive.google.com/viewerng/viewer?embedded=true&url=" + yoururl;
i.setData(Uri.parse(yoururl));
startActivity(i);
If you want it to open in your browser, you need a PDF viewing plugin for your browser.
The same obviously holds true for your visitors as well.
It is the browser which determines what to do with files. (open or dowload)
I have an infopath form which when submitted generates a pdf file with the same form content(XML) using itextsharp library.
I have a node in infopath form that contains the URL of an image from a sharepoint picture library. How do i embed this image into the pdf file generated? Any solution with xslt modification in my xsl file that i am using for transforming the form XML content?
Thanks for the help!
Someone's actually using InfoPath? First I've heard. Wow. Okay, so there's over 400 questions tagged infopath, but still...
iText's general HTML->PDF functions should convert standard <img src="..."> tags to PDF just fine. If that's not an option for some reason, iText's new XMLWorker may do the trick, released with 5.1.0.
There's even a demo page up: http://www.lowagie.com/xmlworker
Export This
The above is a Data URI containing a base 64 encoded csv data export. On my app's report page, I embed the export within each page view so that an export doesn't require another trip to the database.
In Firefox 3, clicking this link opens a save-as download dialog box. Clicking it in Chrome 9 does nothing. I can right-click-save-as in Chrome, and it will write the decoded csv to a file. Clicking it in Safari opens the decoded CSV data in the browser window, which I can then save manually.
In IE... who cares, am I right?
You can reproduce this to test for yourself by copying that <a> tag in it's entirety into a blank file called test.html and open it in each browser. It acts exactly the same way as it does in the context of my app.
Question: Is there a way to force a Save As dialog to pop up, as in Firefox, when the user clicks the Data URI link? Or some other way to get around this inconsistency?
In theory, Firefox, Chrome and Safari all support Data URIs. In practice.......
Unfortunately, application/octet-stream doesn't work too well in Safari (at least Safari 6). It just saves the file as "unknown" with no Save dialog box. To my knowledge, there's no cross-browser way to do what you're trying to do except to bounce the content off a server.