summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_editpage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_editpage.cpp')
-rw-r--r--fpdfsdk/fpdf_editpage.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index 808e330225..5a7312d9f3 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -99,11 +99,11 @@ void CalcBoundingBox(CPDF_PageObject* pPageObj) {
}
}
-const CPDF_Dictionary* GetMarkParamDict(FPDF_PAGEOBJECTMARK mark) {
+CPDF_Dictionary* GetMarkParamDict(FPDF_PAGEOBJECTMARK mark) {
if (!mark)
return nullptr;
- const CPDF_ContentMarkItem* pMarkItem =
+ CPDF_ContentMarkItem* pMarkItem =
CPDFContentMarkItemFromFPDFPageObjectMark(mark);
return pMarkItem->GetParam();
@@ -566,6 +566,26 @@ FPDFPageObjMark_SetBlobParam(FPDF_DOCUMENT document,
return true;
}
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
+FPDFPageObjMark_RemoveParam(FPDF_PAGEOBJECT page_object,
+ FPDF_PAGEOBJECTMARK mark,
+ FPDF_BYTESTRING key) {
+ CPDF_PageObject* pPageObj = CPDFPageObjectFromFPDFPageObject(page_object);
+ if (!pPageObj)
+ return false;
+
+ CPDF_Dictionary* pParams = GetMarkParamDict(mark);
+ if (!pParams)
+ return false;
+
+ auto removed = pParams->RemoveFor(key);
+ if (!removed)
+ return false;
+
+ pPageObj->SetDirty(true);
+ return true;
+}
+
FPDF_EXPORT int FPDF_CALLCONV FPDFPageObj_GetType(FPDF_PAGEOBJECT pageObject) {
if (!pageObject)
return FPDF_PAGEOBJ_UNKNOWN;