Generating PDF server side using node - javascript

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

Related

vuejs pdf from html

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

convert html into jpg and send mail - PHP

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 :-)

Server-side template parsing

I'm currently exploring how to use HandlebarsJS via a server-side parser.
Unfortunately we are limited to using RhinoJS server.
I've searched high and low to find out how to use HandlebarsJS via the server side. I can see how to register a helper and various other things, but I'm curious to know if it's possible to parse a JS or HTML file and have the various portions of the file replaced with the server generated content?
I'm hoping this is possible without using something like node and optimistic that it's possible to parse the file just like you would do using PHP or CFML but using JS under RhinoJS instead.
Any suggestions greatly appreciated.

Programmatically generate preview of Adobe files

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

How to read local (Client) file with GWT?

I would like to use GWT to read and parse local csv file.
EDIT: Local file here means client file.
I know I can use HTML5 with javascript to achieve that, but I would like to use GWT to do it.
One way of doing it is by using JavaScript Native Interface (JSNI), however I think it beats the purpose of using GWT.
Another way of doing this would be upload the file to server, and send it back as a json. But I feel it's not the best way of doing it.
Please advise. Thanks.
EDIT: I intend to design a desktop app, so I try to avoid using any web-server scripting.
Using jsni doesn't beat the purpose of gwt, sometimes you need to use it as a wrapper to functionality not yet available in gwt or an external javascript library. Instead of writting jsni access to the file api you can use one of several third party libraries available that implement html5 file access, like http://code.google.com/p/lib-gwt-file
A quick search returned this SO question: Read text file in google GWT?
Although GWT doesn't support java.io.InputStream, it looks like you could make a request to your CSV File and then parse it.
Remember that if you will host on AppEngine, you won't have a filesystem available so you'll have to have the files hosted elsewhere.

Categories

Resources