summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-07-12 19:45:29 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-12 19:45:29 +0000
commit07520f6e9cfd1c1f304d18af614d83938e382adb (patch)
tree19616c41d1a7540f0bc334164ab76aa44e0f2020 /public
parent83f2d7060194a146ffcb9cbac993178d92a166bc (diff)
downloadpdfium-07520f6e9cfd1c1f304d18af614d83938e382adb.tar.xz
Create API to set and get blob values from a mark dict.
The new functions are: - FPDFPageObjMark_GetParamBlobValue - FPDFPageObjMark_SetBlobParam Bug: pdfium:1037 Change-Id: Ie04df04c64c6cf517a8cde182d7e9a38c3c78d1b Reviewed-on: https://pdfium-review.googlesource.com/37570 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_edit.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h
index e7f6cc4a70..677bce80b1 100644
--- a/public/fpdf_edit.h
+++ b/public/fpdf_edit.h
@@ -407,7 +407,7 @@ FPDFPageObjMark_GetParamIntValue(FPDF_PAGEOBJECTMARK mark,
// out_buflen - pointer to variable that will receive the length of the value.
// Not filled if false is returned.
//
-// Returns TRUE if the key maps to a string value, FALSE otherwise.
+// Returns TRUE if the key maps to a string/blob value, FALSE otherwise.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFPageObjMark_GetParamStringValue(FPDF_PAGEOBJECTMARK mark,
FPDF_BYTESTRING key,
@@ -416,6 +416,26 @@ FPDFPageObjMark_GetParamStringValue(FPDF_PAGEOBJECTMARK mark,
unsigned long* out_buflen);
// Experimental API.
+// Get the value of a blob property in a content mark by key.
+// |buffer| is only modified if |buflen| is longer than or equal to the length
+// of the value.
+//
+// mark - handle to a content mark.
+// key - string key of the property.
+// buffer - buffer for holding the returned value.
+// buflen - length of the buffer.
+// out_buflen - pointer to variable that will receive the length of the value.
+// Not filled if false is returned.
+//
+// Returns TRUE if the key maps to a string/blob value, FALSE otherwise.
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
+FPDFPageObjMark_GetParamBlobValue(FPDF_PAGEOBJECTMARK mark,
+ FPDF_BYTESTRING key,
+ void* buffer,
+ unsigned long buflen,
+ unsigned long* out_buflen);
+
+// Experimental API.
// Set the value of an int property in a content mark by key. If a parameter
// with key |key| exists, its value is set to |value|. Otherwise, it is added as
// a new parameter.
@@ -449,6 +469,25 @@ FPDFPageObjMark_SetStringParam(FPDF_DOCUMENT document,
FPDF_BYTESTRING key,
FPDF_BYTESTRING value);
+// Experimental API.
+// Set the value of a blob property in a content mark by key. If a parameter
+// with key |key| exists, its value is set to |value|. Otherwise, it is added as
+// a new parameter.
+//
+// document - handle to the document.
+// mark - handle to a content mark.
+// key - string key of the property.
+// value - pointer to blob value to set.
+// value_len - size in bytes of |value|.
+//
+// Returns TRUE if the operation succeeded, FALSE otherwise.
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
+FPDFPageObjMark_SetBlobParam(FPDF_DOCUMENT document,
+ FPDF_PAGEOBJECTMARK mark,
+ FPDF_BYTESTRING key,
+ void* value,
+ unsigned long value_len);
+
// Load an image from a JPEG image file and then set it into |image_object|.
//
// pages - pointer to the start of all loaded pages, may be NULL.