diff options
author | xlou <xlou@chromium.org> | 2018-10-11 21:15:18 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-11 21:15:18 +0000 |
commit | c7f66edd224446deefe68506b7ebed871eb5c8c2 (patch) | |
tree | ec6ea7d0c57c1d9211712b87846a1cdb33e5dbba /fpdfsdk/fpdf_transformpage.cpp | |
parent | bfc5f6011dd402a1fc07a522c3f25ab405f3e3ea (diff) | |
download | pdfium-c7f66edd224446deefe68506b7ebed871eb5c8c2.tar.xz |
Add functions to get/set ArtBox.chromium/3578
There are PDFs that use ArtBox. In some use cases, user may scale
a page, scale up/down MediaBox and CropBox. So if ArtBox exists,
it needs to be scaled as well.
Bug:409670
Change-Id: I78ac7afa66942352277f856514bdd9b15dda270b
Reviewed-on: https://pdfium-review.googlesource.com/c/43931
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Shirleen Lou <xlou@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_transformpage.cpp')
-rw-r--r-- | fpdfsdk/fpdf_transformpage.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp index d1f7fceebc..7595086c87 100644 --- a/fpdfsdk/fpdf_transformpage.cpp +++ b/fpdfsdk/fpdf_transformpage.cpp @@ -80,6 +80,15 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetCropBox(FPDF_PAGE page, CFX_FloatRect(left, bottom, right, top)); } +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetArtBox(FPDF_PAGE page, + float left, + float bottom, + float right, + float top) { + SetBoundingBox(CPDFPageFromFPDFPage(page), pdfium::page_object::kArtBox, + CFX_FloatRect(left, bottom, right, top)); +} + FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, float* bottom, @@ -100,6 +109,15 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetCropBox(FPDF_PAGE page, top); } +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetArtBox(FPDF_PAGE page, + float* left, + float* bottom, + float* right, + float* top) { + return GetBoundingBox(CPDFPageFromFPDFPage(page), + pdfium::page_object::kArtBox, left, bottom, right, top); +} + FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX* matrix, |