-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support .pages files #8
Comments
Not as straight forward as first thought. It is just a zip file, but inside there are Apple's IWS files rather than XML. IWA files are a protobuf stream compressed with snappy - sort of. https://github.com/google/protobuf |
The snappy-go implementation doesn't seem to be compatible with Apple's butchered implementation. I'm getting over the missing stream identifier by prepending the reader: The problem now appears to be that Apple is using the old COPY_4 tag which the snappy golang library doesn't support (as in it detects it and says "unsupported COPY_4 tag"). All other golang snappy libraries appear to be based on this one so don't support it either. I've implemented the COPY_4 tag by porting it from implementations in other languages. In particular https://github.com/gray/compress-snappy/blob/master/src/csnappy_decompress.c. However it's now saying that the input is corrupt so there must be something else which I can't track down. At this point I've seen nobody successfully reading these out there so they pretty much need to be considered a proprietary file format. If we want to progress I think the next step is to use the C implementation of snappy to see if that reads it. If it doesn't then I'm not sure where to go next. |
Does this help? .iwa seem to be the same Looks like snappy is kind of followed, but not really. "they do not include the required Stream Identifier chunk, and compressed On Monday, 27 April 2015, oprimus [email protected] wrote:
Hamish Ogilvy |
Any trap on where the corrupt err comes from? e.g. Is it in the header read From what I can read it's definitely doable. Looks like it's in the Can you upload the WIP branch? On Monday, 27 April 2015, oprimus [email protected] wrote:
Hamish Ogilvy |
Commit 7ed3c56
|
These came from: https://github.com/obriensp/iWorkFileFormat/tree/master/iWorkFileInspect or/iWorkFileInspector/Messages/Proto See Issue #8
See Issue #8 This captures some of these.
The snappy tests are failing (no doubt due to the changes you mention here not being compatible with the tests). I have marked the failing tests to be skipped for the moment, but we really need to fix this. |
I see that you include the three cases, if a quickview pdf is available, an xml or the protobuffer iwa. Does any of this work for iworks'14 files? |
Best thing to do is to test it and see. The pages format is pretty hacky |
Looks like a no. 2018/02/01 14:39:28 Received file: t.pages (application/vnd.apple.pages) Edit: I wonder how these guys do it. https://cloudconvert.com/formats/document/pages They manage 5.5 in some way. Only guys I've seen to do it... |
We welcome pull requests! :) |
It’s definitely possible, just need to play with the encoding. It wasn’t documented anywhere well from memory, but may be possibly these days |
Can we easily support the
.pages
extension?The text was updated successfully, but these errors were encountered: