diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-11-24 19:28:25 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-11-25 19:10:53 +0000 |
commit | 6e14149d3e915f559f99276a525862e28d6f0478 (patch) | |
tree | 7caac4b663cb1ac0f1bbfad3a7f89317a644366f /pdf/mupdf.h | |
parent | 7aeb37fc5be2388ad71d9eab04b539c2c49f024e (diff) | |
download | mupdf-6e14149d3e915f559f99276a525862e28d6f0478.tar.xz |
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.
Diffstat (limited to 'pdf/mupdf.h')
-rw-r--r-- | pdf/mupdf.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/pdf/mupdf.h b/pdf/mupdf.h index 22e087f9..e03f6efc 100644 --- a/pdf/mupdf.h +++ b/pdf/mupdf.h @@ -45,6 +45,8 @@ char *pdf_from_ucs2(unsigned short *str); typedef struct pdf_xref_entry_s pdf_xref_entry; typedef struct pdf_crypt_s pdf_crypt; +typedef struct pdf_ocg_descriptor_s pdf_ocg_descriptor; +typedef struct pdf_ocg_entry_s pdf_ocg_entry; struct pdf_xref_entry_s { @@ -55,6 +57,20 @@ struct pdf_xref_entry_s int type; /* 0=unset (f)ree i(n)use (o)bjstm */ }; +struct pdf_ocg_entry_s +{ + int num; + int gen; + int state; +}; + +struct pdf_ocg_descriptor_s +{ + int len; + pdf_ocg_entry *ocgs; + fz_obj *intent; +}; + struct pdf_xref_s { fz_stream *file; @@ -63,6 +79,7 @@ struct pdf_xref_s int file_size; pdf_crypt *crypt; fz_obj *trailer; + pdf_ocg_descriptor *ocg; int len; pdf_xref_entry *table; @@ -474,7 +491,7 @@ void pdf_free_page(pdf_page *page); * Content stream parsing */ -fz_error pdf_run_page_with_usage(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm, char *target); +fz_error pdf_run_page_with_usage(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm, char *event); fz_error pdf_run_page(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm); fz_error pdf_run_glyph(pdf_xref *xref, fz_obj *resources, fz_buffer *contents, fz_device *dev, fz_matrix ctm); |