mupdf
Loading...
Searching...
No Matches
clean.h
Go to the documentation of this file.
1// Copyright (C) 2004-2025 Artifex Software, Inc.
2//
3// This file is part of MuPDF.
4//
5// MuPDF is free software: you can redistribute it and/or modify it under the
6// terms of the GNU Affero General Public License as published by the Free
7// Software Foundation, either version 3 of the License, or (at your option)
8// any later version.
9//
10// MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
11// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13// details.
14//
15// You should have received a copy of the GNU Affero General Public License
16// along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
17//
18// Alternative licensing terms are available from the licensor.
19// For commercial licensing, see <https://www.artifex.com/> or contact
20// Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
21// CA 94129, USA, for further information.
22
23#ifndef MUPDF_PDF_CLEAN_H
24#define MUPDF_PDF_CLEAN_H
25
26#include "mupdf/pdf/document.h"
28
43
48
49typedef struct
50{
53
55
56 /* PDF_CLEAN_STRUCTURE_DROP to drop the structure tree (default).
57 * PDF_CLEAN_STRUCTURE_KEEP to keep it unchanged.
58 * Future values reserved.
59 */
61
62 /* PDF_CLEAN_VECTORIZE_NO to leave the pages unchanged.
63 * PDF_CLEAN_VECTORIZE_YES to vectorize each page (and flatten any Type 3 fonts).
64 * Future values reserved.
65 */
68
69/*
70 Read infile, and write selected pages to outfile with the given options.
71*/
72void pdf_clean_file(fz_context *ctx, char *infile, char *outfile, char *password, pdf_clean_options *opts, int retainlen, char *retainlist[]);
73
74/*
75 Recreate page tree to include only the pages listed in the array, in the order listed.
76*/
77void pdf_rearrange_pages(fz_context *ctx, pdf_document *doc, int count, const int *pages, pdf_clean_options_structure structure);
78
79/*
80 Recreate given page list (or all pages if count == 0), with text being vectorized.
81*/
82void pdf_vectorize_pages(fz_context *ctx, pdf_document *doc, int count, const int *new_page_list, pdf_clean_options_vectorize vectorize);
83
84#endif
pdf_clean_options_structure
Definition clean.h:39
@ PDF_CLEAN_STRUCTURE_DROP
Definition clean.h:40
@ PDF_CLEAN_STRUCTURE_KEEP
Definition clean.h:41
void pdf_clean_file(fz_context *ctx, char *infile, char *outfile, char *password, pdf_clean_options *opts, int retainlen, char *retainlist[])
void pdf_rearrange_pages(fz_context *ctx, pdf_document *doc, int count, const int *pages, pdf_clean_options_structure structure)
pdf_clean_options_vectorize
Definition clean.h:44
@ PDF_CLEAN_VECTORIZE_NO
Definition clean.h:45
@ PDF_CLEAN_VECTORIZE_YES
Definition clean.h:46
void pdf_vectorize_pages(fz_context *ctx, pdf_document *doc, int count, const int *new_page_list, pdf_clean_options_vectorize vectorize)
Definition context.h:886
Definition clean.h:50
pdf_clean_options_structure structure
Definition clean.h:60
pdf_clean_options_vectorize vectorize
Definition clean.h:66
pdf_write_options write
Definition clean.h:51
int subset_fonts
Definition clean.h:54
pdf_image_rewriter_options image
Definition clean.h:52
Definition document.h:463
Definition image-rewriter.h:51
Definition document.h:768