Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fpdf_ppo.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef PUBLIC_FPDF_PPO_H_
8#define PUBLIC_FPDF_PPO_H_
9
10// NOLINTNEXTLINE(build/include)
11#include "fpdfview.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17// Experimental API.
18// Import pages to a FPDF_DOCUMENT.
19//
20// dest_doc - The destination document for the pages.
21// src_doc - The document to be imported.
22// page_indices - An array of page indices to be imported. The first page is
23// zero. If |page_indices| is NULL, all pages from |src_doc|
24// are imported.
25// length - The length of the |page_indices| array.
26// index - The page index at which to insert the first imported page
27// into |dest_doc|. The first page is zero.
28//
29// Returns TRUE on success. Returns FALSE if any pages in |page_indices| is
30// invalid.
32FPDF_ImportPagesByIndex(FPDF_DOCUMENT dest_doc,
33 FPDF_DOCUMENT src_doc,
34 const int* page_indices,
35 unsigned long length,
36 int index);
37
38// Import pages to a FPDF_DOCUMENT.
39//
40// dest_doc - The destination document for the pages.
41// src_doc - The document to be imported.
42// pagerange - A page range string, Such as "1,3,5-7". The first page is one.
43// If |pagerange| is NULL, all pages from |src_doc| are imported.
44// index - The page index at which to insert the first imported page into
45// |dest_doc|. The first page is zero.
46//
47// Returns TRUE on success. Returns FALSE if any pages in |pagerange| is
48// invalid or if |pagerange| cannot be read.
49FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_ImportPages(FPDF_DOCUMENT dest_doc,
50 FPDF_DOCUMENT src_doc,
51 FPDF_BYTESTRING pagerange,
52 int index);
53
54// Experimental API.
55// Create a new document from |src_doc|. The pages of |src_doc| will be
56// combined to provide |num_pages_on_x_axis x num_pages_on_y_axis| pages per
57// |output_doc| page.
58//
59// src_doc - The document to be imported.
60// output_width - The output page width in PDF "user space" units.
61// output_height - The output page height in PDF "user space" units.
62// num_pages_on_x_axis - The number of pages on X Axis.
63// num_pages_on_y_axis - The number of pages on Y Axis.
64//
65// Return value:
66// A handle to the created document, or NULL on failure.
67//
68// Comments:
69// number of pages per page = num_pages_on_x_axis * num_pages_on_y_axis
70//
71FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
72FPDF_ImportNPagesToOne(FPDF_DOCUMENT src_doc,
73 float output_width,
74 float output_height,
75 size_t num_pages_on_x_axis,
76 size_t num_pages_on_y_axis);
77
78// Experimental API.
79// Create a template to generate form xobjects from |src_doc|'s page at
80// |src_page_index|, for use in |dest_doc|.
81//
82// Returns a handle on success, or NULL on failure. Caller owns the newly
83// created object.
84FPDF_EXPORT FPDF_XOBJECT FPDF_CALLCONV
85FPDF_NewXObjectFromPage(FPDF_DOCUMENT dest_doc,
86 FPDF_DOCUMENT src_doc,
87 int src_page_index);
88
89// Experimental API.
90// Close an FPDF_XOBJECT handle created by FPDF_NewXObjectFromPage().
91// FPDF_PAGEOBJECTs created from the FPDF_XOBJECT handle are not affected.
92FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseXObject(FPDF_XOBJECT xobject);
93
94// Experimental API.
95// Create a new form object from an FPDF_XOBJECT object.
96//
97// Returns a new form object on success, or NULL on failure. Caller owns the
98// newly created object.
99FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV
100FPDF_NewFormObjectFromXObject(FPDF_XOBJECT xobject);
101
102// Copy the viewer preferences from |src_doc| into |dest_doc|.
103//
104// dest_doc - Document to write the viewer preferences into.
105// src_doc - Document to read the viewer preferences from.
106//
107// Returns TRUE on success.
109FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc);
110
111#ifdef __cplusplus
112} // extern "C"
113#endif // __cplusplus
114
115#endif // PUBLIC_FPDF_PPO_H_
void Scale(float sx, float sy)
CFX_Matrix()=default
CPDF_ArrayLocker(const CPDF_Array *pArray)
CPDF_DictionaryLocker(const CPDF_Dictionary *pDictionary)
bool KeyExist(const ByteString &key) const
ByteString GetByteStringFor(const ByteString &key) const
int GetPageCount() const
uint32_t AddIndirectObject(RetainPtr< CPDF_Object > pObj)
bool IsDictionary() const
bool IsStream() const
const CPDF_Array * AsArray() const
bool IsNull() const
bool IsReference() const
static constexpr int32_t kNoContentStream
void SetRef(CPDF_IndirectObjectHolder *pDoc, uint32_t objnum)
uint32_t GetRefObjNum() const
bool EqualNoCase(ByteStringView str) const
static ByteString Format(const char *pFormat,...)
ByteString & operator+=(const ByteString &str)
ByteString & operator+=(const char *str)
ByteString & operator=(ByteString &&that) noexcept
bool IsEmpty() const
Definition bytestring.h:119
XObjectContext * XObjectContextFromFPDFXObject(FPDF_XOBJECT xobject)
CPDF_Document * CPDFDocumentFromFPDFDocument(FPDF_DOCUMENT doc)
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_ImportNPagesToOne(FPDF_DOCUMENT src_doc, float output_width, float output_height, size_t num_pages_on_x_axis, size_t num_pages_on_y_axis)
Definition fpdf_ppo.cpp:772
FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseXObject(FPDF_XOBJECT xobject)
Definition fpdf_ppo.cpp:831
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDF_NewFormObjectFromXObject(FPDF_XOBJECT xobject)
Definition fpdf_ppo.cpp:837
FPDF_EXPORT FPDF_XOBJECT FPDF_CALLCONV FPDF_NewXObjectFromPage(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc, int src_page_index)
Definition fpdf_ppo.cpp:814
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc)
Definition fpdf_ppo.cpp:851
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_ImportPages(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc, FPDF_BYTESTRING pagerange, int index)
Definition fpdf_ppo.cpp:751
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_ImportPagesByIndex(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc, const int *page_indices, unsigned long length, int index)
Definition fpdf_ppo.cpp:721
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_ImportNPagesToOne(FPDF_DOCUMENT src_doc, float output_width, float output_height, size_t num_pages_on_x_axis, size_t num_pages_on_y_axis)
Definition fpdf_ppo.cpp:772
#define FPDF_CALLCONV
Definition fpdfview.h:227
#define FPDF_EXPORT
Definition fpdfview.h:221
const char kMediaBox[]
const char kParent[]
const char kContents[]
UnownedPtr< CPDF_Document > dest_doc
Definition fpdf_ppo.cpp:44
RetainPtr< CPDF_Stream > xobject
Definition fpdf_ppo.cpp:45