TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Local PDF Tools – Powered by WebAssembly

227 pointsby twapiover 4 years ago

21 comments

svatover 4 years ago
Last year I wrote a couple of similar &quot;local&quot; PDF tools that run in the browser with no network requests. Each is just a single HTML file that will work offline:<p>- <a href="https:&#x2F;&#x2F;shreevatsa.net&#x2F;pdf-pages&#x2F;" rel="nofollow">https:&#x2F;&#x2F;shreevatsa.net&#x2F;pdf-pages&#x2F;</a> is for extracting pages, inserting blank pages, duplicating or reversing pages, etc.<p>- <a href="https:&#x2F;&#x2F;shreevatsa.net&#x2F;pdf-unspread&#x2F;" rel="nofollow">https:&#x2F;&#x2F;shreevatsa.net&#x2F;pdf-unspread&#x2F;</a> is for splitting a PDF&#x27;s &quot;wide&quot; pages (consisting of two-page spreads) in the middle.<p>- <a href="https:&#x2F;&#x2F;shreevatsa.net&#x2F;mobius-print&#x2F;" rel="nofollow">https:&#x2F;&#x2F;shreevatsa.net&#x2F;mobius-print&#x2F;</a> is the earliest of these, and written for a niche use-case: &quot;Möbius printing&quot; of pages, which is printing out an article&#x2F;paper two-sided in a really interesting order. (I&#x27;ve tried it and love it.)<p>These don&#x27;t use WebAssembly, but just use the excellent &quot;pdf-lib&quot; JS library. To keep the file self-contained, I put the whole minified source into a &lt;script&gt; tag at the bottom of the (otherwise hand-written) HTML file.
评论 #26325976 未加载
评论 #26329197 未加载
评论 #26334799 未加载
kickbeakover 4 years ago
Hey, Thanks for Posting it here, i built this tool, hope you like it, feel free to look at my source and contribute. <a href="https:&#x2F;&#x2F;github.com&#x2F;jufabeck2202&#x2F;localpdfmerger" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jufabeck2202&#x2F;localpdfmerger</a>
Abishek_Muthianover 4 years ago
Is there a .pdf tool which allows compression to a defined file size? Tools like ghostscript can compress a .pdf to different levels of quality by using different setting but not a defined file size; I understand that this has to do with the compression algorithm itself and that data could be compressed only to a certain limit, but what if the file size limit is within that limit?<p>I&#x27;m asking this because an user of my problem validation platform wanted a solution for this[1], because websites requiring document upload have a file size limit and often the compressed file is either above or below the prescribed file size limit thereby loosing out on quality unnecessarily.<p>[1]&#x27;Reduce document file size to specific size&#x27; (I have added the link to it on my profile, since it&#x27;s my own platform).
评论 #26326749 未加载
brailsafeover 4 years ago
I&#x27;d certainly be curious why wasm ends up being 15x slower than native binary in this case, but it&#x27;s not insurmountable. All of the major commercial PDF editing suites use wasm + their own C++ based pdf engine to great effect.<p>The article that this is based on is here, and a good read. It seems like it&#x27;s at least non-trivial to get it working, and I&#x27;d wonder how the process looks for other compiled binaries, having not tried to do that implementation from scratch. <a href="https:&#x2F;&#x2F;dev.to&#x2F;wcchoi&#x2F;browser-side-pdf-processing-with-go-and-webassembly-13hn" rel="nofollow">https:&#x2F;&#x2F;dev.to&#x2F;wcchoi&#x2F;browser-side-pdf-processing-with-go-an...</a>
sigvefover 4 years ago
Looks like this thread is all about sharing our own related local browser-based PDF tools. Here’s mine: <a href="https:&#x2F;&#x2F;pdftotext.github.io" rel="nofollow">https:&#x2F;&#x2F;pdftotext.github.io</a>
kc0bfvover 4 years ago
There are a few versions of tools like this, or similar, available. Here&#x27;s mine:<p><a href="https:&#x2F;&#x2F;kc0bfv.github.io&#x2F;WASM-PDF-Combiner&#x2F;" rel="nofollow">https:&#x2F;&#x2F;kc0bfv.github.io&#x2F;WASM-PDF-Combiner&#x2F;</a><p>I used existing wasm compiles of PDF tools. This use of wasm is pretty awesome to me - I often end up working on very restricted desktop clients with little customization possible, but they always let me run a browser.
评论 #26326541 未加载
评论 #26325297 未加载
codetrotterover 4 years ago
Convenient if you are on a machine where you can’t install software. (Corporate computer, school computer, library computer etc.)<p>For Linux and macOS computers that you are allowed to install software on I recommend the pdftk command line tool.<p>Ubuntu family:<p><pre><code> sudo apt install pdftk </code></pre> macOS with Homebrew:<p><pre><code> brew install pdftk-java</code></pre>
评论 #26325250 未加载
yomansatover 4 years ago
Can one easily install such apps as a Chrome app&#x2F;PWA, and deactivate access to the internet since it doesn&#x27;t need it and one can merge personal PDFs?
mgm__over 4 years ago
I created a PDF table extractor tool last year with the same idea that it should be local only. Try it here: <a href="https:&#x2F;&#x2F;pdftableutil.possiblenull.com&#x2F;app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pdftableutil.possiblenull.com&#x2F;app&#x2F;</a> Also as a Google Docs addon (still local only) <a href="https:&#x2F;&#x2F;workspace.google.com&#x2F;marketplace&#x2F;app&#x2F;pdf_table_importer&#x2F;646940040599" rel="nofollow">https:&#x2F;&#x2F;workspace.google.com&#x2F;marketplace&#x2F;app&#x2F;pdf_table_impor...</a><p>I had a bad case of scope creep, so the tool can also extract tables from scanned&#x2F;image PDFs using OpenCV.js and tesseract OCR wasm build!
评论 #26329470 未加载
评论 #26326401 未加载
danvkover 4 years ago
I’d love a tool (that’s not Acrobat) to manage comments on PDFs.
评论 #26326314 未加载
naedishover 4 years ago
This is helpful. Generally if I need to do any pdf manipulation when I&#x27;m away from my own machine I use an android app - PDF Utils [1].<p>[1] <a href="https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=pdf.shash.com.pdfutility" rel="nofollow">https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=pdf.shash.com....</a>
not_knuthover 4 years ago
Does anyone know some good tutorials&#x2F;explanations for understanding the PDF format at the byte level?
评论 #26326901 未加载
评论 #26326763 未加载
评论 #26326668 未加载
ithkuilover 4 years ago
Anybody knows a simple tool I can use to turn an academic two-column paper into a single column pdf (so I can read it easily on e-paper like a remarkable)?<p>(Ideally I&#x27;d like to be able to run such a tool from browser&#x2F;phone)
评论 #26329585 未加载
georgeutsinover 4 years ago
Looking forward to using this tool! Are there plans to make this open source?
评论 #26324586 未加载
评论 #26324588 未加载
Cianticover 4 years ago
It&#x27;s great to see more PDF tools.<p>Many times I just want to clip white margins from PDFs so that it is easier to view on tablets or phones. Most viewers don&#x27;t have a way to force the clipping of pages, so when you change page the zoom is lost and suddenly all the content is squished to center.<p>Last time I found cli programs to do it aprox. five years ago it was really difficult to find good tools to edit PDFs like that.<p>It&#x27;s actually not trivial task, as sometimes pages have different margins, e.g. odd and even pages has different margins on folding side of page.
travis729over 4 years ago
For something like this, how do we know that the files are not sent to a server? Am I just trusting the web app? Is there any way to be sure other than having and reading the source?
评论 #26325197 未加载
评论 #26325065 未加载
评论 #26332513 未加载
desmapover 4 years ago
Something I still miss is a free and easy PDF tool which lets you delete, reorder and add pages from multiple PDFs. On Windows there is just Xodo but its UX is unfortunately subpar and on macOS you have Preview where the UI is better but once you have multiple PDFs from where you get the pages it can get confusing.
评论 #26325731 未加载
评论 #26325756 未加载
评论 #26325811 未加载
simonmalesover 4 years ago
I have this same idea on my to-do list. Great that people are experimenting with webapps that don&#x27;t send any data!
评论 #26324802 未加载
pabs3over 4 years ago
Hmm, I think I would just compile the pdfcpu Go source to native code, that might be faster than WebAssembly?
评论 #26324977 未加载
horst_vieover 4 years ago
This is a nice usecase for pdfcpu. If you are pdftk user give the pdfcpu CLI a spin. It is multi platform and has some nice features baked in. <a href="https:&#x2F;&#x2F;pdfcpu.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pdfcpu.io&#x2F;</a>
djrogersover 4 years ago
There was an error merging PDFs. Not very helpful, can you tell me what the error was or how to avoid it?