I am working in a GIS app and I have to present the result of a dataset in HTML, but the HTML file is too large.
I now want to convert it to PDF using phantom. Does anyone have a working example?
Related
The issue is that a converted PDF is downloaded by the client. I need the PDF to be saved on server side and sent by mail.
I am using jsPDF and html2canvas for converting HTML to PDF.
I guess that jsPDF is not the proper tool for your task. First line at Github is "Client-side JavaScript PDF generation for everyone" which says it all.
To let the server create a PDF, you need a tool which renders the HTML result and creates a PDF from it. Maybe a MS Word or OpenDocument template used in headless mode will suit your needs, as suggested here among other solutions.
I am trying to generate a PDF from Html page. The Html includes various data returned from django view and also from Vue.js
I tried using 'Weasyprint' but it only generated data that returned from Django but not the charts and graphs that were generated from Vue. What will be an easy way to generate all the data as well as the graphs in PDF from the Html page.
To generate a PDF with those charts, you will need to render the web-page first (in a browser) in order to run the client-side code and use that "result" to generate the final PDF.
It will depend on where you want to generate that PDF (on the server or on the client). In case it is on the server, one possible solution is to use phantomJS (or other similar projects) to render and save the result in a file with render().
I am trying to find a library that can help me implement a document viewer for Node Js as my backend and Angular Js for my frontend web application. Basically this document viewer should be able to support pdf and tiff file formats. It should also help me edit the documents like rotate a page, move a page or delete the page and then submit the edited document. Most of the document viewer libraries i found were for asp.net and paid. Most of the libraries I found for Node JS were just for viewing purposes but not editing them. I would welcome any suggestions or help that can put me in the right direction.
Thank you!
For PDF editing: https://github.com/galkahana/HummusJS
For Tiff editing: http://aheckmann.github.io/gm/
For PDF rendering on the client: https://github.com/mozilla/pdf.js
For Tiff rendering: convert it into jpg/png
In my project, I want to somehow display a pdf file on the page. For this, I am trying to use the <object> tag. So far, so good, since the pdf lives in the /public folder in my Rails app.
The problem is that now I want the user to be able to display a pdf that is on his pc. I tried using Javascript to alter the <object> tag, but that does not work since Rails generates a new GET request to get the file, and the file is not on the server. Any ideas of how I can solve this?
I have tried using PDF.js, but it does not integrate well in the assets pipeline. Also, I would have to customize and hack the code to add some other functionalities, so PDF.js is kinda off the table (at least for now).
You can use the wicked_pdf gem to generate pdf then use Google PDF viewer for displaying it
I am automataing a webbased application using Selenium Webdriver.
A report is generated in PDF format is opened Acrobat reader. I have to save that PDF to a specific location and then close the pdf. So how can it be done thru automation. I tried searching on net and found this can be done using VB script but then need Adobe professional version for the same. Also the report that is generated doesnot have a specific title. That keeps changing.
Can this be done using javascript ?
Thanks
It's possible to generate some PDF in JS, try http://snapshotmedia.co.uk/blog/jspdf
It will return you an base64 string or an URI. Then you can redirect your visitor to the PDF (with this URI) or write down the base64 in a file.