5 ms·
Show HN: PNG to PDF Conversion in the Browser
Hi everyone,
I build some "online" converters as a side project in the last weeks.
The difference to existing conversion websites is, that my converters don't upload your files. Everything happens in your browser on your device (with the help of a lot of great Open Source Javascript libraries).
I think privacy is an essential feature for a service like this, so my converters also don't use google analytics or any other form of tracking (in fact they use no external resources at all).
I started this because I ended up with some .heic files from my iPhone and had to use ImageMagick every time I wanted to upload them somewhere. So now there is https://heic.to-jpg.com https://heic.to-jpg.com and I can just drag and drop .heic-files there to convert them to jpg.
Next I needed to send some stuff to my accountant, so I made pictures, but he wanted a pdf. So I made https://png.to-pdf.net https://png.to-pdf.net and I can drag and drop multiple png's and it will return a pdf with one image per page.
There are a lot of other converters that basically came free with the libraries I used, you can find them all in the sidebar (e.g. https://tiff.to-png.com https://tiff.to-png.com).
I hope some of you will find this usefull.
- gitgud 5y agoGreat little tool, just curious why you would buy several domains to host these tiny single page tools? to-pdf.net, to-png.com, to-jpg.com... Does SEO really reward this more than simply using pathnames on a single domain?
- deleted 5y ago[deleted]
- DarthNebo 5y agoFor folks who need an offline tool, macOS has it in the right-click menu for most file formats under > Quick Actions.
- markdown 5y agoHmmm, that sounds like something I'd consider upgrading up from Mojave for.
- DarthNebo 5y agoYou can checkout this too from Monterey, https://support.apple.com/en-in/guide/preview/prvw625a5b2c/mac https://support.apple.com/en-in/guide/preview/prvw625a5b2c/m... very handy when dealing with screenshots & random pics with text that need to be extracted.
- growt 5y agoWow, today I learned, thank you. I honestly didn't know that. To my defense, I rarely use finder and forklift doesn't display Quick Actions. But had I known, I would probably not have made these converters, so it was probably alright.
- octagonal 5y agoFinder.app and Preview.app are surprisingly decent format conversion tools
- zeepzeep 5y ago> I hope some of you will find this usefull. You're my new default converter! I really like that this is happening on the client. There were quite a few times where I "had to" use an online converter and did not feel comfortable. Most things today can be done client side, there's no reason that I have to upload my stuff.
- darcien 5y agoHey, thanks making it. Easy to use and loads fast, perfect! Talking about .heic, recently I learned that Shortcuts app from Apple in iPhone can do a various image operation, like resizing and converting between formats. The one I used the most is resize to smaller size since .heic is gigantic. All I need to do is setup the shortcut once [1], then I can resize any photo I took from quick actions in gallery. Bonus, it also convert the image to .png for me. If I remember correctly, Shortcuts also support converting image to PDF, so it's pretty powerful. Because of it, I stopped using free website for converting stuffs and just do it on the phone. But I still like your website ;) [1] I don't remember which article I read, but this one looks like a good starting point for setting up the shortcut - https://www.switchingtomac.com/tutorials/iphone/how-to-resize-pictures-on-iphone/ https://www.switchingtomac.com/tutorials/iphone/how-to-resiz...
- kretaceous 5y agoReally neat! Thanks for these. Can you tell me how to generally go about making these converters? I've always wondered how all these file conversions (especially the image ones) are developed. Is it specific for one file type to another or is there some general method which can be used? How is this achieved in the browser itself?
- growt 5y agoMost of these go through a canvas element, which is something a browser can "draw on". For conversion from jpg to png for example you don't need any libraries at all because your webbrowser can read and write both of these formats: "draw" jpg on a canvas and read it as png, done. For others like heic and pdf I used open source JS libraries such as pdfJS.
- aardvark179 5y agoAlthough that is an approach that can work, it's likely a very good way to either lose the colour space and meta data for an image, or to force it into sRGB. which is always a little disappointing if the source and destination support something better.
- jiffygist 5y agoWhy should it be A4 instead of the same dimensions as png?
- growt 5y agoMostly because it's the common format for documents where I live. Also you can add multiple images with different dimensions and they will all be scaled to fit A4. But I will probably add different dimensions for other countries in the future.
- Tagbert 5y agoBeing tied to specific paper sizes is one of the biggest limitations of PDF. I run into this a lot when people try to distribute documents as PDF. There are a lot of assumptions built in when a PDF is generated.
- kinard 5y agoAgreed, I think the PDF should be created at the same size of the original image. Or at least have an option to do so.
- driverdan 5y agoWhy would you want to convert a PNG to PDF? I don't understand the point.
- growt 5y agoAs I wrote above, I build a bunch of converters. If PNG to PDF has no use for you, then maybe heic to jpg, or tiff to png, or webp to jpg? If you already have a quick and good solution for all of these (or you never need to convert in any of those ways), then that's fine too.
- readme 5y agoSo you can make things like this: https://i.imgur.com/uq4a4PY.png https://i.imgur.com/uq4a4PY.png
- Tagbert 5y agoSo... did you do PNG to PDF to PNG for that? :)
- acadiasprings 5y agoOne example is that students often have to turn in files in PDF format but may not have a scanner for handwritten papers. It's not amazing quality, but this let's you take a photo with your phone and convert it to PDF for submission.
- KMnO4 5y agoThere are bespoke tools for scanning documents with your phone and exporting to PDF. The quality is MUCH better this way, as it automatically crops, aligns, and dewarps the image, plus applies filters to adjust the colours. You would have a hard time differentiating this from a proper scan. (For example, Microsoft Lens: https://apps.apple.com/ca/app/microsoft-lens-pdf-scanner/id975925059 https://apps.apple.com/ca/app/microsoft-lens-pdf-scanner/id9...)
- growt 5y ago
- WilsonSquared 5y agoThanks for this! Such a nice and simple tool!