blob: be340f44a181bef14dd4874dd9d635dbc334b90f [file] [log] [blame]
John Abd-El-Malek5110c472014-05-17 22:33:34 -07001// Copyright 2014 PDFium Authors. All rights reserved.
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 _FPDFSAVE_H_
8#define _FPDFSAVE_H_
9
10#include "fpdfview.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16
17// Structure for custom file write
18struct FPDF_FILEWRITE{
19
20 //
21 //Version number of the interface. Currently must be 1.
22 //
23 int version;
24
25 //
26 // Method: WriteBlock
27 // Output a block of data in your custom way.
28 // Interface Version:
29 // 1
30 // Implementation Required:
31 // Yes
32 // Comments:
33 // Called by function FPDF_SaveDocument
34 // Parameters:
35 // pThis - Pointer to the structure itself
36 // pData - Pointer to a buffer to output
37 // size - The size of the buffer.
38 // Return value:
39 // Should be non-zero if successful, zero for error.
40 //
41 int (*WriteBlock)( FPDF_FILEWRITE* pThis, const void* pData, unsigned long size);
42
43};
44
45
46/** @brief Incremental. */
47#define FPDF_INCREMENTAL 1
48/** @brief No Incremental. */
49#define FPDF_NO_INCREMENTAL 2
50
51
52// Function: FPDF_SaveAsCopy
53// Saves the copy of specified document in custom way.
54// Parameters:
55// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
56// pFileWrite - A pointer to a custom file write structure.
57// flags - The creating flags.
58// Return value:
59// TRUE for succeed, FALSE for failed.
60//
61DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
62 FPDF_DWORD flags );
63
64// Function: FPDF_SaveWithVersion
65// Same as function ::FPDF_SaveAsCopy, except the file version of the saved document could be specified by user.
66// Parameters:
67// document - Handle to document.
68// pFileWrite - A pointer to a custom file write structure.
69// flags - The creating flags.
70// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
71// Return value:
72// TRUE if succeed, FALSE if failed.
73//
74DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
75 FPDF_DWORD flags, int fileVersion);
76
77#ifdef __cplusplus
78};
79#endif
80
81#endif //_FPDFSAVE_H_