I am using next js for my web application, I am having a requirement where when a user uploads a pdf to my input, I will have to compress it (for example: 1MB). I searched here and there, but I am not able to get a prominent solution which can help me out! If I cannot compress a pdf, I would at least like to convert it into an Image, which I can use a library to convert? Can someone help me out on how to compress a PDF?
I would recommend:
Convert API
You have to pay, but it is a very easy and clean solution.
Alternatively, you can use:
Shrink PDF
...which is a wrapper for ghost script. more complex than the Convert API but easier than implementing ghost script yourself.
Or:
Ghost script
...You can implement it yourself if you wish.
Realistically, you are not going to be able to get a simple Node package where you can just do pdf.compress() and it is done well, unless it is a paid API.
Related
I am planning to create a React frontend which handles HTML presentations. Besides letting the users present online, they should also be able to download their HTML presentation as PPT (like Google Slides).
I have not yet decided on what package to use for creating the presentations, but most of the packages seem to only support the typical print-download (the PDF that is converted from the HTML when you press cmd/ctrl + P). One exception is PptxGen, but that package is not an option for me (because of reasons not related to this question).
Is there a way for me to download a HTML page to PPT?
(There are multiple ways to download html to PDF - jsPDF being one. If it's cumbersome to download html as PPT, perhaps it's possible to converting html -> PDF -> PPT and then download it? Any advice?)
Thanks in advance!
Even after extensive searching, I did not find any other open-source library that handles direct HTML-to-PPT conversions, apart from PptxGenJS, so we can conclude that if you want a direct conversion, that's your only option.
There are some other ways to do this though, one that you mentioned is converting to PDF, then to PPT. I have found a service that can do both conversions, called Cloudmersive. They seem to have a free tier, and a Javascript API client that you can use from your frontend, so this is probably worth giving a try. If this managed service also doesn't suit your needs for any reason, you can still handle the conversions yourself, for example, with jsPDF and
pdf-officegen.
I want to create dynamic pdf files and embed initials and signature to them inside browser. I found pdfkit.org but I need a more comprehensive solution that allows creating functionalities similar to what you see in docusign. Are there solution out there that you can point me to?
From farther research, I learned that PDF & Javascript are good friends. The easiest way to achieve manipulating content within a pdf is to convert it to html, add the changes to it and then convert it back to pdf. There are a few different services available that help you with this kind of conversion. Here are a few of those services:
https://cloudconvert.com
http://www.pdfonline.com/
https://market.mashape.com/netservice/convert-pdf-to-html
We are thinking about a library which can get a TIFF image and display each page (frame) of TIFF file in a separate canvas element. Also some pages might have layers. We want to be able to show/hide layers at user's will.
It is not necessary to tell me the complete solution or library. Just tell me if it is possible to accomplish all these requirements by javascript or we need to get help of server-side programming?
Should be possible. I don't think browsers support the TIFF format natively, but a quick Google search turns up at least two TIFF parsers for JavaScript. From there on, you can display it in any way you like; tiff.js even has a multipage demo.
I have a node web app that needs to convert a docx file into pdf (using client side resources only and no plugins). I've found a possible solution by converting my docx into HTML using docxjs and then HTML to PDF using jspdf (docx->HTML->PDF).
This solution could make it but I encountered several issues especially with rendering. I know that docxjs doesn't keep the same rendering in HTML as the docx file so it is a problem...
So my question is do you know any free module/solution that could directly do the job without going through HTML (I'm open to odt as a source as well)? If not, what would you advise me to do?
Thanks
As you already know there is no ready-to-use and open libs for this.. You just can't get good results with available variants. My suggesition is:
Use third party API. Like https://market.mashape.com/convertapi/word2pdf-1#!documentation
Create your own service for this purpose. If you have such ability, I suggest to create a small server on node.js (I bet you know how to do this). You can use Libreoffice as a good converter with good render quality like this:
libreoffice -headless -invisible -convert-to pdf {$file_name} -outdir /www-disk/
Don't forget that this is usually takes a lot of time, do not block the request-answer flow: use separate process for each convert operation.
And the last thing. Libreoffice is not very lightweight but it has good quality. You can also find notable unoconv tool.
As of January 2019, there is docx-wasm, which works in node and performs the conversion locally where node is installed. Proprietary but freemium.
It appears that even after three years ncohen had not found an answer. It was also unclear if it had to be a free (as in dollars) solution.
The original requirements were:
using client side resources only and no plugins
Do you mean you don't want server side conversion? Right, I would like my app to be totally autonomous.
Since all the other answers/comments only offered server side component solutions, which the author clearly stated was not what they wanted, here is a proposed answer.
The company I work for has had this solution for a few years now, that can convert DOCX (not odt yet) files to PDF completely in the browser, with no server side component required. This currently uses either asm.js/PNaCl/WASM depending on the exact browser being used.
https://www.pdftron.com/samples/web/samples/viewing/viewing/
Open an office file using the demo above, and you will see no server communication. Everything is done client side. This demo works on mobile browsers also.
this is just a rough idea, i am trying to create a magazine reading platform and i need the reading flow to be smooth, and so is the magazine upload process, it must be fast and easy. so i am thinking of using pdf file.
I am thinking is it possible to have a module(maybe a system?) to pull each page from the pdf and display it in a interface written in html? i know there is something similar in flash, but what i want it is something lighter and easier from development. coz at the end i am gonna put this module into maybe a cms system.
thanks in advance guys:)
Regards,
WJ
hi guys i just found this solution, pdf.js, it uses javacript to implement pdf displaying on the web page, it also able to create pdf file from javascript.
anyway the reader is there, and interface is able to change since it is html, i guess this should be the solution.