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