How convert pdf to picture in the react js without large library? - javascript

I Want to get uploaded file from user and convert it to the picture in the client , i found pdfjs-dist and react-pdf , but they have a large size and not optimized for use , and i think they are not tree-shakeable , I appreciate to suggest me a good library or a good way to convert

Related

Dynamically Saving Images to a PDF template

I'm building a website where people can pick several pictures from a range.
I then want the users to be able to create a PDF using those pictures. However I want those pictures inserted in predefined positions and sizes in a template I have already created which will contain other predone materials (words pictures etc).
So my question :
its possible ?
Can anyone recommend a library which will satisfy my needs, I have had a look and I cant see any PDF libraries that seem to mention templates
Any guidance on where to start will be greatly appreciated.
Yes, this is completely possible.
I would recommend using wkhtmltopdf to generate the pdfs from an html template.
Another handy library for this kind of work is image.intervention
Both of these would work with PHP.
If you're working in javaScript you may want to use PDFKit
Edited: Only if you use php.
There are several libraries you can use to generate a pdf depending on what template you will build your pdf. I hardly recommend TCPDF. You can use html to layout the design you want or you can embed the image directly on a page. See an example here.

Generate and download Zip file on the fly in (client-side) JS

I have n Javascript float arrays.
My goal is to generate and download a Zip file, using JS only, containing n CSV files, one per array.
I am aware of Javascript librairies like JSZip: http://stuk.github.io/jszip/ for generating zip files.
I also know how to generate and download a file on the fly using Blob and/or a library like FileSaver.js
However, I cannot figure out how to achieve the whole thing, client-side only.
Can anybody help me ?

Need to convert PCX graphic to binary

I have an application that requires I convert a PCX graphic to binary. There is very little info on the internet on how to do this. I can accomplish this with canvas.toDataURL using JS but only for PNG and JPEG graphic files. This is not for a SQL database as I think you can do it there. Any help would be appreciated, even if it involves using an app to get me there.
I have no idea what you mean by your question, but I presume that if you can do whatever it is that you want with a JPEG file but can't do that with a PCX file, it would help if you could convert your PCX to a JPEG.
So I would suggest you use "convert" from ImageMagick (here)
convert image.pcx image.jpg
Here is a text file:
This is the first line
You can read me, con't you?
Yes, it's because I am text
Here is a binary file:
<FF><D8><FF><E0>^#^PJFIF^#^A^A^A^#^A^#^A^#^#<FF><DB>^#C^#^C^B^B^B^B^B^C^B^B^B^C^C^C^C^D
^L^R^S^R^P^S^O^P^P^P<FF><DB>^#C^A^C^C^C^D^C^D^H^D^D^H^P^K ^K^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P^P<FF><C0>^#^Q^H^A<90>^#<C8>^C^A"^#^B^Q^A^C^Q^A<FF><C4>^#^]^#^#^#^G^A^A^A^#^#^#^#^#^#^#^#^#^#^#^B^C
^D^E^F^G^H^A <FF><C4>^#8^P^#^A^C^C^C^B^E^B^D^F^C^#^B^C^#^#^A^B^C^Q^#^D!^E^R1^FA^G^S"Qaq<81>^T2<91><A1>^H^U#B<B1><D1>R<C1><E1>^V<F0>3br<FF><C4>^#^Z^A^#^B^C^A^A^#^#^#^#^#^#^#^#^#^#^#^B^C^A^D^E^#^F<FF><C4>^#/^Q^#^B^B^A^D^A^C^

Javascript TIFF Image Conversion

I am looking for a way to convert a Tiff image into a png so modern browsers can render it. I have looked at Tiffus, but that doesn't look like it is being developed anymore. I have also tried writing a conversion program in C# and sending through JSIL, but that didn't work either. I have also tried using Tiff-js but the sample project isn't working. Does anyone know how to do this? I know I can do it in C#/server-side but we want to try to do it client side.
I ported LibTIFF to Javascript with Emscripten ( https://github.com/seikichi/tiff.js , demo: http://seikichi.github.io/tiff.js/basic.html)

Create GRF from BMP or HTML5 Canvas pixel data

How can I create a Zebra GRF image from HTML5 canvas pixel data or a monochrome BMP file using javascript? I can't find any information on the format of GRF files.
Here is the ZPL programming manual.
The ~DG command will tell you the format of the GRF format. Then it's just some math
You might have to convert this Java code to Javascript, but I came across this and make a command line java app to help. If you can go to the server at all, then you could probably just invoke this app through shell.
https://github.com/asharif/img2grf

Categories

Resources