News for hackers. Stuff that matters.
Re:Preview in macOS Big Sur is destroying PDFs by izacus on Wednesday December 16, 2020 @04:15PM (#25448800)
> 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.

Re:Preview in macOS Big Sur is destroying PDFs by TwoBit on Wednesday December 16, 2020 @04:27PM (#25448941)
And yet PDF re-writing keeps getting screwed up. Probably because it really is a bad format for this, with the pages of docs notwithstanding.
Re:Preview in macOS Big Sur is destroying PDFs by izacus on Wednesday December 16, 2020 @05:44PM (#25449802)
Sure, PDF re-writing is one of very clear non-goals when you read the spec. It's designed to be generated, always consistent and then later annotated and marked up.

And that doesn't make it read-only. It just makes it not suitable for live text editing just like a PNG isn't suitable for collaborative image work.

Re:Preview in macOS Big Sur is destroying PDFs by theamk on Wednesday December 16, 2020 @11:07PM (#25452337)
Eh, "remove empty page" is not "live text editing". I have seen tools struggle with seemingly simple operations, like "take page 1,4 from A and pages 4,6 from B, scale to fit paper size and combine into one file". And those are not some exotic requirements, those are one of the most basic operations people want to do with multi-page documents.

Also, did you want to say JPEG isn't suitable for collaborative image work (because it's lossy?). As PNG is a pretty fine exchange format if two people, who prefer different graphical editors, want to work on the same document.

Re:Preview in macOS Big Sur is destroying PDFs by virgilp on Wednesday December 16, 2020 @05:03PM (#25449404)
I never saw these screw-ups in Acrobat, so maybe the problem is not the format, but Apple?
Re:Preview in macOS Big Sur is destroying PDFs by dkonofalski on Wednesday December 16, 2020 @05:26PM (#25449637)
Then you probably don't use Acrobat enough. PDF is a finicky mistress.
Re:Preview in macOS Big Sur is destroying PDFs by virgilp on Thursday December 17, 2020 @06:33AM (#25454637)
Maybe; 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.

Re:Preview in macOS Big Sur is destroying PDFs by dkonofalski on Thursday December 17, 2020 @01:21PM (#25458469)
I don't think I'm letting Apple off easy because I don't think it's not their fault. I just think that, until we see the document in question, we can't squarely say that it is their fault. Preview and Acrobat both have ways of dealing with junk/bogus data and I feel like that's what's going on here. There must have been some kind of bit switched when the document was "corrected" and it's possible that Acrobat and Preview just resolve that issue differently while both still outputting "valid" PDF files.
Re:Preview in macOS Big Sur is destroying PDFs by theamk on Wednesday December 16, 2020 @11:01PM (#25452303)
Sure, but the major text is still "write once" -- you can only add specially designated information to a read-only core.

As this article shows, a trivial operation on the core text, like "remove a blank page", is still very hard and pretty easy to get wrong.

I think having general Turing-complete power in a document format is a horrible idea. It's a pity we ended up with it. Something like OpenOffice's presentations ("odp") is also a single file which is layed out per page, and can be annotated, commented, approved, edited and so on, while not being Turing-complete.

Re:Preview in macOS Big Sur is destroying PDFs by Igelau on Wednesday December 16, 2020 @05:13PM (#25449499)
le sigh the surface changes you're talking about are small potatoes compared to removing a page and altering document structure without breaking anything.
Re:Preview in macOS Big Sur is destroying PDFs by izacus on Wednesday December 16, 2020 @05:41PM (#25449774)
I've worked on PDF editing library long enough to have a very good understanding how PDFs can break. And also good enough understanding why they're designed as they are - there are some rather forward thinking approaches the authors took in 1.0 and 1.2 spec standards.

Editing actual page contents is hard but the format itself wasn't designed with live editing in mind. Instead, they made a tradeoff to render the document consistently on all devices which has made the format so popular.