summaryrefslogtreecommitdiff
path: root/public/fpdf_save.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-05-11 14:27:24 -0700
committerTom Sepez <tsepez@chromium.org>2015-05-11 14:27:24 -0700
commitac19d2d8f64ab87577f167e0a8df075a7fe3ffdc (patch)
tree3c8e9be3b07c4818c7866babf3f98ef78aed8fc2 /public/fpdf_save.h
parent06272311aca7ead4f419b65ca41673f1599218ae (diff)
downloadpdfium-ac19d2d8f64ab87577f167e0a8df075a7fe3ffdc.tar.xz
Create top-level public/ header directory.
These are the only files that embedders of PDFium should be including. They are entirely self-contained, and compile cleanly against -Wall so as to not offend the code that may include them. Having done this, we can see that chromium is pulling in two additional files from the fpdfsdk/include/pdfwindow directory, which is not guaranteed to work. A few files are renamed, adding an "_" to make the names consistent. The exception is fpdfview, which is doc'd as such in the doc. Naturally, paths will need updating in a handful of files in chrome when this rolls in. BUG=pdfium:154 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1135913002
Diffstat (limited to 'public/fpdf_save.h')
-rw-r--r--public/fpdf_save.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/public/fpdf_save.h b/public/fpdf_save.h
new file mode 100644
index 0000000000..0909d5a447
--- /dev/null
+++ b/public/fpdf_save.h
@@ -0,0 +1,82 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FPDFSAVE_H_
+#define _FPDFSAVE_H_
+
+#include "fpdfview.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+// Structure for custom file write
+struct FPDF_FILEWRITE{
+
+ //
+ //Version number of the interface. Currently must be 1.
+ //
+ int version;
+
+ //
+ // Method: WriteBlock
+ // Output a block of data in your custom way.
+ // Interface Version:
+ // 1
+ // Implementation Required:
+ // Yes
+ // Comments:
+ // Called by function FPDF_SaveDocument
+ // Parameters:
+ // pThis - Pointer to the structure itself
+ // pData - Pointer to a buffer to output
+ // size - The size of the buffer.
+ // Return value:
+ // Should be non-zero if successful, zero for error.
+ //
+ int (*WriteBlock)( FPDF_FILEWRITE* pThis, const void* pData, unsigned long size);
+
+};
+
+
+/** @brief Incremental. */
+#define FPDF_INCREMENTAL 1
+/** @brief No Incremental. */
+#define FPDF_NO_INCREMENTAL 2
+/** @brief Remove security. */
+#define FPDF_REMOVE_SECURITY 3
+
+// Function: FPDF_SaveAsCopy
+// Saves the copy of specified document in custom way.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
+// pFileWrite - A pointer to a custom file write structure.
+// flags - The creating flags.
+// Return value:
+// TRUE for succeed, FALSE for failed.
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
+ FPDF_DWORD flags );
+
+// Function: FPDF_SaveWithVersion
+// Same as function ::FPDF_SaveAsCopy, except the file version of the saved document could be specified by user.
+// Parameters:
+// document - Handle to document.
+// pFileWrite - A pointer to a custom file write structure.
+// flags - The creating flags.
+// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
+// Return value:
+// TRUE if succeed, FALSE if failed.
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
+ FPDF_DWORD flags, int fileVersion);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif //_FPDFSAVE_H_