summaryrefslogtreecommitdiff
path: root/source/xps/xps-doc.c
AgeCommit message (Collapse)Author
2017-12-13Parse XML using pool allocator.Tor Andersson
This needs adding a fz_xml_doc type to hold the pool.
2017-09-07Initialize variables to appease clang scan-build.Sebastian Rasmussen
2017-04-27Avoid typecasting function pointers in subclasses.Tor Andersson
Do the typecasting in the functions instead, reducing the risk of function prototype mismatches.
2017-04-27Typedef function pointers consistently.Tor Andersson
2017-04-27Remove debug printing code.Tor Andersson
It's not used, so prone to bit rot. Better to purge it.
2017-04-27Include required system headers.Tor Andersson
2017-04-13Move extension/mimetype detection to common function.Sebastian Rasmussen
A document handler normally only exposes a list of extensions and mimetypes. Only formats that use some kind of extra detection mechnism need to supply a recognize() callback, such as xps that can handle .xps-files unpacked into a directory.
2017-03-28Return fz_document from all document handlers.Sebastian Rasmussen
To make it possible to avoid casting in most cases.
2017-03-23Introduce fz_new_derived_...Robin Watts
Instead of having fz_new_XXXX(ctx, type, ...) macros that call fz_new_XXXX_of_size etc, use fz_new_derived_... Clearer naming, and doesn't clash with fz_new_document_writer.
2017-03-22Update fz_new_page.Robin Watts
Move this into the same style as fz_new_document and fz_new_image.
2017-01-09Make fz_parse_xml take a fz_buffer. Make xps_part contain a fz_buffer.Tor Andersson
2016-11-14Add/fix page coordinates to link targets.Tor Andersson
Correctly transformed target coordinates for PDF. Target coordinates for EPUB and HTML.
2016-10-19Move headers to make xps_document an internal type.Sebastian Rasmussen
2016-10-18Internal drop functions don't need to check for NULL.Sebastian Rasmussen
2016-07-12xps: Only recognize <dir>/_rels/.rels type paths, not any .rels file.Tor Andersson
2016-07-08Separate close and drop functionality for devices and writers.Tor Andersson
Closing a device or writer may throw exceptions, but much of the foreign language bindings (JNI and JS) depend on drop to never throw an exception (exceptions in finalizers are bad).
2015-10-06xps: Add separate link parsing step.Tor Andersson
Don't rely on having to run the page once with an identity transform before being able to load the links.
2015-10-02fz_link fixes.Robin Watts
Make fz_link reference counting threadsafe. Remember to free dests of GOTO links. Accordingly, ensure that XPS does not create links with uninitialised dests.
2015-02-26Clean up some type casts.Tor Andersson
2015-02-17Add ctx parameter and remove embedded contexts for API regularity.Tor Andersson
Purge several embedded contexts: Remove embedded context in fz_output. Remove embedded context in fz_stream. Remove embedded context in fz_device. Remove fz_rebind_stream (since it is no longer necessary). Remove embedded context in svg_device. Remove embedded context in XML parser. Add ctx argument to fz_document functions. Remove embedded context in fz_document. Remove embedded context in pdf_document. Remove embedded context in pdf_obj. Make fz_page independent of fz_document in the interface. We shouldn't need to pass the document to all functions handling a page. If a page is tied to the source document, it's redundant; otherwise it's just pointless. Fix reference counting oddity in fz_new_image_from_pixmap.
2015-02-17Rename fz_close_* and fz_free_* to fz_drop_*.Tor Andersson
Rename fz_close to fz_drop_stream. Rename fz_close_archive to fz_drop_archive. Rename fz_close_output to fz_drop_output. Rename fz_free_* to fz_drop_*. Rename pdf_free_* to pdf_drop_*. Rename xps_free_* to xps_drop_*.
2014-09-17xps: Add fz_xml_is_tag to simplify tag matching.Tor Andersson
2014-09-17Improve XML parser.Tor Andersson
Add a whitespace preserving mode, for future use with XHTML. Also parse XHTML entities. This is not strictly according to spec, but for properly formed XML documents it should not matter.
2014-07-02Handle the application/xps mimetype.Matt Holgate
I think this is non-standard, but some applications seem to use it. The email app on Android uses it, despite the fact the original email actually embedded it as application/octet-stream. I guess the email app is looking at the filename.
2014-04-23Fix bug 693580 by skipping xml tag namespace prefixes.Tor Andersson
fts_5904.xps and fts_5905.xps use namespace prefixes. Work around that by ignoring the namespace prefix for tag names. A more robust solution would be to expand or record the tag and attribute namespaces in the fz_xml node structure, but that's a overkill for our current needs.
2014-01-07Introduce 'document handlers'.Robin Watts
We define a document handler for each file type (2 in the case of PDF, one to handle files with the ability to 'run' them, and one without). We then register these handlers with the context at startup, and then call fz_open_document... as usual. This enables people to select the document types they want at will (and even to extend the library with more document types should they wish).
2014-01-06fix various MSVC warningsSimon Bünzli
Some warnings we'd like to enable for MuPDF and still be able to compile it with warnings as errors using MSVC (2008 to 2013): * C4115: 'timeval' : named type definition in parentheses * C4204: nonstandard extension used : non-constant aggregate initializer * C4295: 'hex' : array is too small to include a terminating null character * C4389: '==' : signed/unsigned mismatch * C4702: unreachable code * C4706: assignment within conditional expression Also, globally disable C4701 which is frequently caused by MSVC not being able to correctly figure out fz_try/fz_catch code flow. And don't define isnan for VS2013 and later where that's no longer needed.
2013-07-19Initial work on progressive loadingRobin Watts
We are testing this using a new -p flag to mupdf that sets a bitrate at which data will appear to arrive progressively as time goes on. For example: mupdf -p 102400 pdf_reference17.pdf Details of the scheme used here are presented in docs/progressive.txt
2013-06-20Rearrange source files.Tor Andersson