b***@artifex.com
2017-05-31 13:45:56 UTC
http://bugs.ghostscript.com/show_bug.cgi?id=697972
Bug ID: 697972
Summary: proposal to fix portfolios in Acrobat
Product: MuPDF
Version: master
Hardware: PC
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: P4
Component: mupdf
Assignee: mupdf-***@artifex.com
Reporter: ***@pragmata.tk
QA Contact: gs-***@ghostscript.com
Word Size: ---
I think there is a much easier approach to portfolios that work fine
with Acrobat and other PDF viewers that handle attachments: mutool
portfolio, Foxit Reader, SumatraPDF, poppler (which means evince and
Okular), and the built-in viewer in Firefox. (These are the ones I
tested.)
Please, consider this, because using /Collection might cause
compatibility issues with non-Acrobat viewers.
Before analyzing the proposal, let’s see the difference:
* mutool portfolio right now (Loading Image...).
No access to attached files.
* Proposal (Loading Image...).
The file I created with mutool is
http://pdf.ousia.tk/uncompressed-mupdf-portfolio.pdf (btw, all PDF
documents are uncompressed for [at least, my] editing convenience).
I created the document with:
mutool portfolio mupdf-portfolio a attachment.pdf "χαλεπὰ τὰ καλά"
/Catalog reads:
1 0 obj
<<
/Type /Catalog
/Pages 2 0 R
/Collection <<
/Names <<
/EmbeddedFiles <<
/Names [ <CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
<<
/CI <<
/EF <<
/F 7 0 R
/F <CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
/UF <CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
/Desc
<CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
/Type /Filespec
<CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC> ]
endobj
Acrobat may not work, because /Collection is empty (only a guess).
A simpler /EmbeddedFiles dictionary may help a lot
(http://pdf.ousia.tk/uncompressed-mupdf-attachments.pdf):
1 0 obj
<<
/Type /Catalog
/PageMode /UseAttachments
/Pages 2 0 R
/Names <<
/EmbeddedFiles <<
/Names [ (attachment.pdf) <<
/EF <<
/F 7 0 R
/F (attachment.pdf)
/UF (attachment.pdf)
/Desc
<CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
/Type /Filespec
The relevant changes are:
1. Removed /Collection.
2. Deployed/PageMode /UseAttachments instead.
If /PageMode is to a different value, set it to /UseAttachments.
3. In /Names array /F value used, instead of /Desc to list elements.
4. In /F entry, ASCII file name used, not /Desc (attached file name,
not entry in mutool portfoliio parlance).
5. In /UF, used at least the same value as /F.
Unicode may come later (it should have its own value).
6. /Desc should be properly encoded.
My guess, you are using a UTF-8 instead of the right enconding
(UTF-16BE or UCS-2, I dunno).
7. Removed empty /CI from /Names array entry (only required by
/Collection).
8. Removed /Limits from /EmbeddedFiles (not sure it’s mandatory).
I edited the a uncompressed copy of the original with gvim. I have used
PDF32000_2008.pdf (the PDF spec) and a similar file created with
ConTeXt (http://pdf.ousia.tk/uncompressed-real-attachment.pdf).
Bug ID: 697972
Summary: proposal to fix portfolios in Acrobat
Product: MuPDF
Version: master
Hardware: PC
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: P4
Component: mupdf
Assignee: mupdf-***@artifex.com
Reporter: ***@pragmata.tk
QA Contact: gs-***@ghostscript.com
Word Size: ---
I think there is a much easier approach to portfolios that work fine
with Acrobat and other PDF viewers that handle attachments: mutool
portfolio, Foxit Reader, SumatraPDF, poppler (which means evince and
Okular), and the built-in viewer in Firefox. (These are the ones I
tested.)
Please, consider this, because using /Collection might cause
compatibility issues with non-Acrobat viewers.
Before analyzing the proposal, let’s see the difference:
* mutool portfolio right now (Loading Image...).
No access to attached files.
* Proposal (Loading Image...).
The file I created with mutool is
http://pdf.ousia.tk/uncompressed-mupdf-portfolio.pdf (btw, all PDF
documents are uncompressed for [at least, my] editing convenience).
I created the document with:
mutool portfolio mupdf-portfolio a attachment.pdf "χαλεπὰ τὰ καλά"
/Catalog reads:
1 0 obj
<<
/Type /Catalog
/Pages 2 0 R
/Collection <<
/Names <<
/EmbeddedFiles <<
/Names [ <CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
<<
/CI <<
/EF <<
/F 7 0 R
/F <CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
/UF <CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
/Desc
<CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
/Type /Filespec
]
/Limits [ <CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC><CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC> ]
endobj
Acrobat may not work, because /Collection is empty (only a guess).
A simpler /EmbeddedFiles dictionary may help a lot
(http://pdf.ousia.tk/uncompressed-mupdf-attachments.pdf):
1 0 obj
<<
/Type /Catalog
/PageMode /UseAttachments
/Pages 2 0 R
/Names <<
/EmbeddedFiles <<
/Names [ (attachment.pdf) <<
/EF <<
/F 7 0 R
/F (attachment.pdf)
/UF (attachment.pdf)
/Desc
<CF87CEB1CEBBCEB5CF80E1BDB020CF84E1BDB020CEBACEB1CEBBCEAC>
/Type /Filespec
]
endobjThe relevant changes are:
1. Removed /Collection.
2. Deployed/PageMode /UseAttachments instead.
If /PageMode is to a different value, set it to /UseAttachments.
3. In /Names array /F value used, instead of /Desc to list elements.
4. In /F entry, ASCII file name used, not /Desc (attached file name,
not entry in mutool portfoliio parlance).
5. In /UF, used at least the same value as /F.
Unicode may come later (it should have its own value).
6. /Desc should be properly encoded.
My guess, you are using a UTF-8 instead of the right enconding
(UTF-16BE or UCS-2, I dunno).
7. Removed empty /CI from /Names array entry (only required by
/Collection).
8. Removed /Limits from /EmbeddedFiles (not sure it’s mandatory).
I edited the a uncompressed copy of the original with gvim. I have used
PDF32000_2008.pdf (the PDF spec) and a similar file created with
ConTeXt (http://pdf.ousia.tk/uncompressed-real-attachment.pdf).
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are receiving this mail because:
You are the QA Contact for the bug.