I have an HTML which contains images and javascript charts. I want to convert that HTML into an image and send as an attachment through email.
Is it possible?
If yes, which library should I use for this task?
Yes it's possible, but for that you need to use phantomjs.
Here is a php library i used for phantomjs.
http://jonnnnyw.github.io/php-phantomjs/
Its pure php solution (using phantomjs browser) and is very easy to use. Just install this library through composer and that's it you should be good to go.
Note: This solution is valid if you want to take screenshot of your html page through its URL.
Hope it helps :-)
Related
I need to generate pdf and paste the values of variables in certain places. In fact, this is going to be an order confirmation on my site. Later I will store it on firebase storage. which library do you recommend? Is there any way to generate pdf from html layout?
Yes, there are.
Python has : xhtml2pdf to convert html to pdf.
Otherwise, I would strongly recommend reportlab (still for python)
If you prefer to use Javascript there is PDFKit
I would like to ask
Is it possible to edit the PDF file? For example, insert a new pages between pages , like add page between page 17 and 19.
Which library can i use?
one way to do this is to use ghostscript to split the pdf into individual page images and then you can add additional pages and rearrange pages as needed with tcpdf or similar pdf library.
You can generate pdf easily using FPDF library http://www.fpdf.org/. But you can not edit them via this library. You can use FPDI library mentioned here: PDF Editing in PHP?.
Here is my view:
It is easy to edit Hypertext rather than PDF it self. I use TCPDF to convert HTML to PDF.
Take a look at this. It might be helpful : TCPDF_import is not bringing in an existing file
Thanks, Let us know if you find a better solution.
I've looked on google for the ways to do this. I've found a lot of non maintained libraries. There doesn't seem to be any "fresh" information about this.
I need to generate my PDF on the server side. I'll have dynamic data.
Is the way to go still with PhantomJS?
Yes ,you can use pdfkit library for pdf generation in node js.
i am also using the same library for pdf generation.
visit https://www.npmjs.com/package/pdfkit .
or https://github.com/devongovett/pdfkit/blob/master/demo/browser.js
or
http://pdfkit.org/demo/browser.html
I am willing to programmatically generate file previews for a large set of Adobe files. This should be done programmatically (not via user interface via recorded actions).
The idea is to generate jpg/png previews for psd files, pdf preview for indd files and so on.
Is there a library or SDK to easily do that?
I am open to every programming language that can get the job done, however I prefer a js solution since I am willing to run the script on a nodeJS server.
Is there any system requirement or program to be installed to make this thing work? Do I need an Adobe subscription to do that?
Thank you in advance.
I cannot find yet a proper solution in JavaScript. But this is a reference link I found on search engines.
https://unix.stackexchange.com/questions/11835/pdf-to-jpg-without-quality-loss-gscan2pdf
With ImageMagick on a server, it may help solve the problem.
Another reference link is on about to improve the speed and reduce the memory consumption. This may also help you integrate it on your server.
https://serverfault.com/questions/167573/fast-pdf-to-jpg-conversion-on-linux-wanted
This code snippet may help you. You may have to apply back-ends on your server instead of directly integrating it in your NodeJS server.
convert -density 300 file.pdf page.jpg
Would it be possible to use the inbuilt Javascript in adobe pdf forms to get contents/scrape a web page?
When I googled if Javascript could do this there where CSP errors,
but pdf forms does not have this as far as I know.
thanks,
g3
As you suspected, it is not possible to achieve this with Acrobat's Javascript extensions.
There are a number of third party tools that can convert a website to a pdf. If you also need to build a form, rather than just convert a webpage, you could write a program that would leverage a third party conversion tool, then build the form using Acrobat's Interapplication Communication API reference. If you're more comfortable with Javascript, you could even use the PDDoc's JSObject to build the form with Javascript.
You could use the wkhtmltopdf tool to get the HTML Content of a website and save it to a PDF
Then you can simply run
wkhtmltopdf http://google.com google.pdf to get the Content of Google.com and save it to the PDF "google.pdf".
It is possible. Check out the methods of Net.HTTP found in the "JavaScript for Acrobat API Reference". You might find a more recent version of the reference here.