summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-clean-file.c
AgeCommit message (Collapse)Author
2018-04-27Use pdf_dict_get_int, etc.Tor Andersson
2018-04-25Remove document argument from pdf_new_primitive functions.Tor Andersson
Also remove useless pdf_new_null and pdf_new_bool functions. Use the PDF_NULL, PDF_TRUE, and PDF_FALSE macros instead.
2018-04-25Tweak ordering of constant pdf_obj enums to make PDF_NULL == NULL.Tor Andersson
2018-04-24Remove need for namedump by using macros and preprocessor.Tor Andersson
Add a PDF_NAME(Foo) macro that evaluates to a pdf_obj for /Foo. Use the C preprocessor to create the enum values and string table from one include file instead of using a separate code generator tool.
2018-01-31Use convenience pdf dictionary/array creation functions.Tor Andersson
2017-10-12Don't cache page count in pdf_document.Tor Andersson
Make sure any changes to the page tree are always reflected immediately. The rev_page_map lookup cache exists when we load the outlines in order to resolve links faster, so we don't need to worry about that one. The linear_page_refs stuff is more troublesome, so don't mix editing a PDF with progressive loading!
2017-09-07Use dict_put_drop/array_push_drop wherever possible.Sebastian Rasmussen
2017-04-27Include required system headers.Tor Andersson
2016-09-05Mutool clean: Avoid "Not a dict (<NULL>)" errorRobin Watts
If there are no outlines, don't throw an error trying to strip them.
2016-07-31Make mutool clean only iterate over valid link annotations.Sebastian Rasmussen
2016-07-06Start slimming pdf_page.Tor Andersson
We want to turn pdf_page into a thin wrapper around a pdf_obj, so that any updates to the underlying PDF objects will be reflected without having to reload the pdf_page.
2016-07-06Remove premature optimization: don't bother to resolve page objects.Tor Andersson
2016-07-06pdf: Flatten inheritable page properties when copying pages.Tor Andersson
Affects pdfclean, pdfmerge, and pdfposter.
2016-05-13Add common page range parsing function for tools.Tor Andersson
2016-05-06Mutool clean: Copy OCProperties when subsetting.Robin Watts
Otherwise files (such as bug696754.pdf) can go wrong.
2016-04-29muclean: Avoid warning when no Outlines present in document.Robin Watts
2016-04-22pdf: Remember to drop objects inserted into dicts.Sebastian Rasmussen
2016-04-18Fix leak of pdf_obj.Robin Watts
Use pdf_dict_put_drop rather than pdf_dict_put to avoid leaking int pdf_obj.
2016-03-01Rename pdf_close_document to pdf_drop_document.Tor Andersson
2016-02-29Strip outlines when cleaning a pdf file.Robin Watts
Arrange to keep only the Outline entries that still refer to valid pages. More specifically, leaf outline entries that refer to pages that are elided are not dropped. Non leaf outline entries that refer to pages that have been elided are kept (for the sake of the children) but have NULL destinations.
2016-02-22Fix Annot handling in mutool clean.Robin Watts
When cleaning a file, we discard any Annot entries that no longer point to genuine pages. Or at least, we should have done, were it not for the fact that we only handled the /A form of Annots, and not the /Dest form of annots. Fixed here.
2015-12-18Remove fz_save_document and use pdf_save_document directly instead.Tor Andersson
In preparation of adding pdf_write_document that writes a document to a fz_output stream.
2015-12-15Rename fz_write_x to fz_save_pixmap_as_x or fz_save_bitmap_as_x.Tor Andersson
Separate naming of functions that save complete files to disk from functions that write data to streams.
2015-04-09Remove the _no_run functions.Tor Andersson
The new pdfclean sanitize functionality mean that mutool now needs the data files, so maintaining the split that was designed to keep data files out of mutool is no longer viable.
2015-04-06Move the guts of pdfclean into the lib.Robin Watts
Michael needs to be able to call pdfclean from gsview. At the moment he's having to do this by including the pdfclean.c file into the lib build, and then calling pdfclean_main with a faked up command line. This isn't nice. pdfclean.c is implemented by pdfclean_main parsing the options/filenames out of argv and then passing the filenames/options on to a pdfclean_clean function. This seems like a much nicer API to offer to the world. We therefore pull the guts of pdfclean.c (pdfclean_clean and its subsidiary structures/functions) into pdf-clean-file.c and include this in the library build. This leaves pdfclean.c just as the command line parsing. This should not affect the size of any of the resulting binaries.