Earlier quoted context omitted.
Aren’t the blend modes supported just the Porter-Duff compositing modes? You might think that’s overkill, but it’s a really good mapping of what other rendering pipelines offer and it can really help reduce the work to produce a PDF.
The original Porter-Duff compositing operators don’t cover Photoshop-style blending. Here’s a link with pictures: http://ssp.impulsetrain.com/porterduff.html The Porter-Duff operators are appealingly rigorous and easy to implement because they’re simply the possible combinations of a simple formula. But many of these operators are not very useful either. The Photoshop blending modes are practically the opposite: they…
So you want to modify the text of a PDF by hand (2020)
51–60 of 103 posts
Re: So you want to modify the text of a PDF by hand (2020)
#52Re: So you want to modify the text of a PDF by hand (2020)
#53Anybody trying to do this is missing the point of PDF: It’s a page-description format and therefore only represents the marks on a page , not document structure . One should not attempt to edit a PDF, one should edit the document from which the PDF is generated.
I'll stop trying to edit PDFs when people stop sending me PDFs that I want to edit. Somehow it became "unprofessional" to just send meant-to-be-editable documents around for everyone to enjoy, so this is where we end up...
Re: So you want to modify the text of a PDF by hand (2020)
#54The PDF specification is wild. My current favourite trivia is that it supports all of Photoshop's layer blend modes for rendering overlapping elements.[1] My second-favourite is that it supports appended content that modifies earlier content, so one should always look for forensic evidence in all distinct versions represented in a given file.[2] It's also a fun example of the futility of DRM. The spec includes passwo…
Re: So you want to modify the text of a PDF by hand (2020)
#55Although this is an interesting dive into the PDF format, just opening the PDF in Libreoffice or Inkscape usually works fine to modify its text.
Re: So you want to modify the text of a PDF by hand (2020)
#56Re: So you want to modify the text of a PDF by hand (2020)
#57You can do this: pdf2ps a.pdf # convert to postscript "a.ps" vim a.ps # edit postscript by hand ps2pdf a.ps # convert back to pdf Some complex pdf (with embedded javascript, animations, etc) fail to work correctly after this back and forth. Yet for "plain" documents this works alright. You can easily remove watermarks, change some words and numbers, etc. Spacing is harder to modify. Of course you need to know some po…
Honestly, it seems like only malware authors benefit from the complexity of pdfs.
Re: So you want to modify the text of a PDF by hand (2020)
#58https://github.com/whyboris/PDF-to-JPG-to-PDF
A government form didn't have editable fields that needed to be filled out. And editing the PDF was impossible (password protection). This was my solution.
Re: So you want to modify the text of a PDF by hand (2020)
#59Re: So you want to modify the text of a PDF by hand (2020)
#60PDF is such a weird format. Not so long ago I had to write some Java code for manipulating PDFs: find a string, remove it and place an image at the former string position. I should have known better as I thought "Well, how hard can that be?” What followed was a deep dive down the rabbit hole, a lot of fiddling with the same tools the author of this gist is using trying to make sense of it all. The final solution work…
Very hard?
I worked on a tool that generated PDFs based on API responses. The tool added charts from the api data.
Those PDFs were reports with some hardcoded text.
Yesh what a fun ride that was.