Discussion:
[gs-bugs] [Bug 697972] - MuPDF - proposal to fix portfolios in Acrobat
b***@artifex.com
2017-05-31 13:45:56 UTC
Permalink
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
]
/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
]
endobj

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).
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-05-31 13:47:53 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=697972

Pablo Rodríguez <***@pragmata.tk> changed:

What |Removed |Added
----------------------------------------------------------------------------
Depends on| |697727
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-06-05 23:06:22 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=697972

Sebastian Rasmussen <***@hotmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Post by b***@artifex.com
A simpler /EmbeddedFiles dictionary may help a lot
This link doesn't work.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-06-06 14:43:13 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=697972

Pablo Rodríguez <***@pragmata.tk> changed:

What |Removed |Added
----------------------------------------------------------------------------
Version|master |unspecified

--- Comment #2 from Pablo Rodríguez <***@pragmata.tk> ---
(In reply to Sebastian Rasmussen from comment #1)
Post by b***@artifex.com
Post by b***@artifex.com
A simpler /EmbeddedFiles dictionary may help a lot
This link doesn't work.
Sorry, Sebastian, for the wrong link.

http://pdf.ousia.tk/uncompressed-mupdf-attachment.pdf is the right link (after
all, there is only an attachment ;-)).
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-20 16:56:32 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=697972

--- Comment #3 from Pablo Rodríguez <***@pragmata.tk> ---
The proposal is simple: use attachments instead of portfolios with MuPDF.

I think the implementation is much simpler and this is compatible with a wider
range of PDF viewers.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-26 20:22:44 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=697972

Pablo Rodríguez <***@pragmata.tk> changed:

What |Removed |Added
----------------------------------------------------------------------------
Summary|proposal to fix portfolios |proposal to fix portfolios
|in Acrobat |in Acrobat (use attachments
| |instead)
--
You are receiving this mail because:
You are the QA Contact for the bug.
Loading...