12 ms·
Why anyone treats PDF as anything but a write-once format is beyond me. It's so finicky that I'm not shocked bugs like this happen. The only programs I'd be rea
by xxpor 6y ago
Why anyone treats PDF as anything but a write-once format is beyond me. It's so finicky that I'm not shocked bugs like this happen. The only programs I'd be reasonable sure wouldn't screw it up are Acrobat itself, and pdflatex and friends.
I think we need a multi-image container format. It could be something that's literally a bunch of jpgs/pngs/pick your poison in a tar container, and given a new extension. OSes would open it and present it as a gallery in order. There's no value in a non-ocr'd PDF existing. For OCR'd text that gets more complicated, but it feels like we should be able to come up with a common denominator that doesn't have the legacy of a binary format derived from postscript in the early 90s.
- bigbubba 6y agoIn many industries, writable PDFs are commonplace and aren't seen to be a problem because people in those industries don't see any problem with using Acrobat. If you want to unseat Acrobat and PDF, I think you'll have to provide something that has equivalent or greater power. As for multi-image container formats, I think we already have that: cbz/cbr. Just a zip or rar archive with images in it, to be displayed in order by name. This 'format' is in common use already for scans of comic books. There are numerous viewers you can use to open and browse these files. Something to consider though; accessibility. A screen reader needs to use OCR to read these files to people with impaired vision. PDF files aren't fantastic for screen readers either, but they're much better than just a JPEG. I'd love to see some sort of subtitle system for images (I think mpv could probably overlay a subtitle sidecar on a still image, but that's not widely supported. Text-based subtitles formats are easy to wire into text to speech though.)
- gfody 6y agoyou can also embed images and fonts in svg, probably not as reliable as pdf for pixel-perfect reproductions everywhere though
- bigbubba 6y agoIs there any way to embed raster graphics into an svg? If so, maybe svg could be used as a text-capable container for raster images.
- gedy 6y agoSure, data urls in image tag. (Not sure how practical that is for file size)
- unilynx 6y agoYep, they can, at least JPEG and PNG. (and if you're not precise enough with your questions, some designers will simply send you a PNG-base64-blob-inside-SVG if you ask them "can we have a SVG version of that icon")
- systemvoltage 6y agoPDF is one of the best things IMO - it's like a docker container for documents. The way the original authors intended it to be, including fonts and all the things that go into making a document. For example, I personally like to purchase books that are in PDF format, not epub/mobi. I want to rely on professional typesetting from the publishers, not some front-end engineer's vision of what the ebook should look like and how it should be presented to the user. It works only for novels and long form reading where typesetting is not critical. Basically any book that also has a good audiobook version works fine with epub/mobi since visual formatting is a non-issue. For everything else - programming books to research papers, PDF is great. Can PDF format be improved? Sure, but the level of adoption and its widespread use is more important than fixing copy paste and content migration aspects of PDFs. What I absolutely DO NOT WANT - is web page like format with auto-flowing text and something that fits to the screen with user styling/typesetting. That IMO defeats the purpose of what the container is supposed to do, i.e. contain and not leak. It should most definitely have fixed physical dimensions (or pixels).
- ketamine__ 6y agoWhat device do you use to read PDF's?
- crazygringo 6y agoI personally use an iPad. It's amazing for it. Especially when you use the Apple Pencil to highlight text, make annotations like circles or question marks, etc.
- db48x 6y agoThere are already a handful of multi-image container formats. They're all images inside zipfiles, of course.
- monocasa 6y agoThe comic book piracy community in fact does have what you're asking for. The formats .cbz, .cbr, etc. are just zip and rar files respectively, with images inside and a standard format for the internal filenames so they're presented in order by your reader. Would love something like that with svg allowed inside to support vector drawings.
- ASalazarMX 6y agoAnd this has become the de facto open standard, supported by many document viewers, probably because it's a very straightforward combination of two widely used tools.
- crazygringo 6y agoBecause you often have no choice. You have a PDF of a book and you need to export the pages of a single chapter to a new PDF. Or you have 30 different PDF's that you need to combine into a single one. Or a full-color large-filesize scanned PDF that you need to convert to a smaller-sized black-and-white one. Or you need to copy quotes from a PDF to paste somewhere else. I could go on... PDF's are documents, and normal workflows involve all sorts of conversion and rearrangement and processing of documents. That's the whole point.
- _-david-_ 6y agoNone of those require modifying the existing document. A new document could be produced and the existing document(s) would only be read from.
- crazygringo 6y agoOh. Well, I mean... sometimes it's just easier to "Save" rather than "Save As"? (Or on macOS now, "Save" rather than "Duplicate" then "Save".) It's supposed to be a valid assumption that re-saving a lossless document in its native format won't destroy parts you haven't touched.
- ruined 6y agoThere already exist formats as you describe, but regardless, a change of format wouldn't fix anything. The same problem would just surface there, as Preview and whatever add support for those formats, and include editing features. If you don't want to break something, just don't try to edit it. That can't be enforced anywhere but at the individual user level. Even proprietary formats in first-party software have this problem. Hell, plain-text editors have this problem.
- pm215 6y agoIt would help if Preview wasn't really keen on editing the document, though. I find it tries to modify PDFs quite often -- I think it happens if I accidentally click on a table as I scroll through the document. I have resorted to 'chmod 0444 *.pdf' on my folder of datasheets and manuals so it can't mess with what I want to be a read-only file. Preview is the only pdf viewer I've ever needed to do that for. I've never wanted to edit a PDF, so personally I'd rather the feature was gated behind a menu option or something so you had to deliberately ask for it.
- sildur 6y agoBlind and shortsighted people may not like your idea. There are accessibility options in PDF, but even a regular one can be accessed with a screen reader. Your images won't.
- bigbubba 6y agoIt's also generally a pain in the ass for people with good vision too, since text can't be copied out of a JPEG. If you want to forward a paragraph of text from a pure raster document, you have to read and type it all out yourself.
- fomine3 6y agoIt's also blocker for machine translation.
- theamk 6y agoIt's not like PDF is the only one with text layer, or the only options are PDF, JPG or PNG. DjVU can have text layers as well, and I think SVG too?
- jrochkind1 6y agoMaking a PDF include OCR'd text seems to by definition require writing twice. It has to be edited to add the OCR'd text that was not in the original image-only PDF, no? I mean, you can say that the second PDF is a different PDF that has only been written once, but you can say that about literally any edit, "write once" no longer means anything if you think about it that way.
- aardvark179 6y agoYou can do the OCRing as a part of the original scanning process. You define a blank font and place the letters at the appropriate points to allow text selection. This is also done for documents that use fonts which are not licensed for embedding, it reduces on screen rendering quality slightly as you have lost any hinting information but it’s fine with printing and reserves the intent.
- tonyedgecombe 6y agoPDF does support appending to the file and it’s not just for adding pages. You can make changes throughout the original document. I’m not sure that is what Preview does though.
- thordenmark 6y ago"Why anyone treats PDF as anything but a write-once format is beyond me." Some of use work in print publishing and being able to edit PDF's is critical.
- izacus 6y ago> Why anyone treats PDF as anything but a write-once format is beyond me. sigh These kind of ignorant statemens really annoy me. The massive part of PDF spec is dedicated to editable features (annotations, form filling and digital signatures) which are used by massive industries daily because it brings them a lot of value. It's REALLY not that hard to think for a second and remember why having a single file which can be: - Edited, annotated and commented - Approved with explicit markers - Digitally signed by auditors and reviewers with tamper protection - Rendered on anything that has a semblance of interactive UI with graceful degradation - Archived on any kind of file storage is insanely useful and valuable for massive worldwide industries.
- TwoBit 6y agoAnd yet PDF re-writing keeps getting screwed up. Probably because it really is a bad format for this, with the pages of docs notwithstanding.
- virgilp 6y agoI never saw these screw-ups in Acrobat, so maybe the problem is not the format, but Apple?
- dkonofalski 6y agoThen you probably don't use Acrobat enough. PDF is a finicky mistress.
- virgilp 6y agoMaybe; but I do have the full suite. Have used it plenty during the pandemic to fill in forms digitally (some that were designed to be filled in digitally, others that were not), both on an iPad and on computers. Sure, I'm not a hardcore professional user but those wouldn't be using Preview anyway; I'd bet my family usage is consistently above average. (also used it before the pandemic - I used to work for Adobe, for 10 years, though not in the Document Cloud group). [edit] I should clarify that "I never personally experienced Acrobat bugs that would corrupt my document", not that they don't exist; am not claiming that Acrobat is flawless, and maybe if I went to dig into the bug tracker I could've found document corruption bugs too, who knows. The format is certainly messy [+], I don't deny that. However, I think in this instance you're letting Apple off the hook too easily - this one is decidedly their screwup, not Adobe's. [+] not the basics of it, that's fine; but the "trying to do too much" part.
- SoSoRoCoCo 6y agoHere's is one good reason: My company uses digital certificate signing on PDF. It is a very common usage. We have yet to migrate to DocuSign.
- nine_k 6y agoPDF is often called "electronic paper", meaning its primary use, typesetting documents on screen and paper alike. I'd rather view that PDF is an electronic clay tablet. You can put any text or image on it, but once it's formed, you better not try to alter it, lest you break it.
- christkv 6y agoCBR and CBZ for comics fits this I think?
- ernst_klim 6y ago> Why anyone treats PDF as anything but a write-once format is beyond me. Hahaha. Quite a lot of people around me think that PDF is a collection of JPEGs glued together (because they mostly see PDF as scanned non-OCRed docs).
- eddieh 6y agoWe have that container format. It is called: TIFF
- richard_todd 6y agoThere are lots of image-container formats. DjVu is my favorite, and supports OCR text annotations also. But, outside of some niches, it has fallen out of use these days. Adobe closed the quality gap by adding jbig2 and jpeg2000 support to PDF, making it possible to build a "bunch of images" PDF with similar quality to DjVu.
- yarcob 6y agoBasic PDF editing (adding, removing, reordering, cropping and rotating) has been rock solid in Apple's Preview app. It's something that I dearly miss when I'm on Windows. Which makes showstopper bugs like this a very unfortunate. But then again, it's been common knowledge that you shouldn't upgrade to a .0 release...
- helmholtz 6y agoI'm not sure how widely you've sampled the field on Windows, but in case you don't know it, I can recommend PDF-Xchange Editor. They forced it upon us at my workplace and it seemed dodgy as hell at first. But I've been using it steadily and now I really like it. I'm a paper-free researcher so I no longer print research papers. Instead, I annotate/highlight/comment using this software, and it's worked so well that I've installed it on my personal machine as well. I've tried all of the commands you've mentioned, and so far it's worked without a hitch.
- yarcob 6y agoThanks for the hint, I'll check it out!
- qwerty456127 6y ago> Why anyone treats PDF as anything but a write-once format is beyond me. Because PDF is supposed to be like electronic paper and you normally can draw on a paper original. In an ideal world OSes and apps would be better equipped to separate data and metadata and work with multi-stream files. Every file would have different kinds of pure data (e.g. scanned picture and OCRed text), metadata (e.g. title, author, ISBN/etc IDs, ToC etc) and user-generated annotations in separate streams. But our actual world is not ideal, we mix everything into one stream for every document and allow the apps modify it every time we view it.
- m463 6y agoWhat annoys me is that there are some .pdf manuals I want to refer to, and when I view them in preview and go to quit it asks if I want to keep my changes or revert them. WTF? why does viewing a manual - and I only used navigation like page up / page down - cause modifications?
- soraminazuki 6y agoYou've likely created a text box by double clicking on the document.
- idle_zealot 6y ago> I think we need a multi-image container format. It could be something that's literally a bunch of jpgs/pngs/pick your poison in a tar container You've just described the .cbt format! https://en.m.wikipedia.org/wiki/Comic_book_archive https://en.m.wikipedia.org/wiki/Comic_book_archive
- marcan_42 6y agoAnd it's a bad format, because .tar does not have an index that allows random access. It also does not have compression, unless you stick it in gzip, which makes it even worse because then you can't even skip entries, you have to decompress the whole thing from the top. .zip is better, at least that has an index, but at the end of the file, so it's not linearly streamable. For what it's worth, .pdf is structurally ~the same as .zip; the index is at the end, and blocks are compressed individually. Choice of archive format matters :-)
- Freak_NL 6y agoMost comics using this meta-format seem to use .cbr (Rar) or .cbz (Zip). The main benefit is that reader software understands the intended use of these archives, and you can link a comic book reader to these file extensions.
- CamperBob2 6y ago.PDF works just fine. Don't blame the shortcomings of crappy software implementations on the format itself. We need a format that will still be readable 100 years or more from now, and .PDF serves that purpose.
- cmiller1 6y ago> The only programs I'd be reasonable sure wouldn't screw it up are Acrobat itself Oh no, I've seen acrobat screw with it too
- Siira 6y agoWe already have CBR/CBZ.
- Yetanfou 6y agoStrangely enough (?) I have not had many problems with PDF, certainly no more than with other document formats. I often use tools like pdftk [0] (as found on many Linux distributions) to split sections out of PDFs, create new ones out of single-page PDFs created with ImageMagick, create odd-even page versions etc. I generally do not touch the more "advanced features" like embedded JS (which I have disabled in all readers which support it), I just use it as a document format which more or less guarantees the resulting document looks the way it was meant to, plus or minus a few fonts. For that purpose it works works well enough. The "bunch of jpgs/pngs/pick your poison in a tar container" format you describe exists in a fashion: Comic Book Archive, a format meant for and mostly used for comics. It consists of a compressed archive which contains sequentially numbered "pages" which can be JPEG, PNG or other image file formats. For pure image documents it can be used as a replacement for PDF but since it does not support text it can not be used for scanned OCR'ed documents. DjVu [2] does support a text layer but that comes at the cost of complexity, it is far from the simple container you propose. Since an OCR'ed text layer needs to save not only the text itself but also the location on the image for each character I don't see any way to avoid complexity here. [0] https://www.pdflabs.com/tools/pdftk-server/ https://www.pdflabs.com/tools/pdftk-server/ [1] https://en.wikipedia.org/wiki/Comic_book_archive https://en.wikipedia.org/wiki/Comic_book_archive [2] https://en.wikipedia.org/wiki/DjVu https://en.wikipedia.org/wiki/DjVu