Bug 692314 - take inline OCGs (optional content groups) into account
Summary: take inline OCGs (optional content groups) into account
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: unspecified
Hardware: PC Windows 7
: P4 normal
Assignee: Tor Andersson
URL: http://code.google.com/p/sumatrapdf/i...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-29 20:05 UTC by zeniko
Modified: 2021-05-12 15:21 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
Invite.pdf (246.93 KB, application/pdf)
2011-11-25 18:18 UTC, Robin Watts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zeniko 2011-06-29 20:05:21 UTC
This is a follow up to bug 691528: The document at the URL has an inline OCG that should only be rendered for the "Print" target. And http://www.creepingfog.com/grrr/Invite.pdf contains a dozen inline OCGs of which only a few are supposed to be displayed.
Comment 1 zeniko 2011-07-02 08:55:48 UTC
Partial fix: http://code.google.com/p/sumatrapdf/source/detail?r=4018
Comment 2 zeniko 2011-07-02 11:44:25 UTC
Looks like the inline OCGs in the document from http://code.google.com/p/sumatrapdf/source/detail?r=4022 were a red herring. That document's printing behavior is fixed, if the Print flag for annotations is respected (fix: http://code.google.com/p/sumatrapdf/issues/detail?id=1272 ).

The "partial fix" is thus largely complete, except that it doesn't fully implement the visibility calculations PDF would offer for OCGs.
Comment 3 Robin Watts 2011-11-25 18:18:34 UTC
Created attachment 8154 [details]
Invite.pdf
Comment 4 Robin Watts 2011-11-25 18:48:26 UTC
I've added (at least initial) support for optional content groups (both inline and XObjects) in my local repo:


commit d744ac7f5bd6e64cc834bee3a1cec67a77cbafd3
Author: Robin Watts <robin.watts@artifex.com>
Date:   Thu Nov 24 19:28:25 2011 +0000

    First cut at support for OCGs in mupdf (bug 692314)

    When opening a file, create a pdf_ocg_descriptor that lists the OCGs
    in a file. Add a new function to allow us to set the configuration
    in use (currently just the default one).

    This sets the states of the OCGs as appropriate. When decoding the
    file respect the states of the OCGs.

    This results in Invite.pdf rendering correctly.

    There is more to be done in this area (with automatic setting of
    OCGs by language/zoom level etc), but this is a good start.

I'll close this bug when that hits the main repo.
Comment 5 Robin Watts 2011-12-23 17:56:20 UTC
Closing