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 /public | |
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 'public')
-rw-r--r-- | public/fpdf_transformpage.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/public/fpdf_transformpage.h b/public/fpdf_transformpage.h index 742da490fa..c1abe76979 100644 --- a/public/fpdf_transformpage.h +++ b/public/fpdf_transformpage.h @@ -45,6 +45,21 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetCropBox(FPDF_PAGE page, float top); /** + * Set "ArtBox" entry to the page dictionary. + * + * page - Handle to a page. + * left - The left of the rectangle. + * bottom - The bottom of the rectangle. + * right - The right of the rectangle. + * top - The top of the rectangle. + */ +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetArtBox(FPDF_PAGE page, + float left, + float bottom, + float right, + float top); + +/** * Get "MediaBox" entry from the page dictionary. * * page - Handle to a page. @@ -81,6 +96,24 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetCropBox(FPDF_PAGE page, float* top); /** + * Get "ArtBox" entry from the page dictionary. + * + * page - Handle to a page. + * left - Pointer to a float value receiving the left of the rectangle. + * bottom - Pointer to a float value receiving the bottom of the rectangle. + * right - Pointer to a float value receiving the right of the rectangle. + * top - Pointer to a float value receiving the top of the rectangle. + * + * On success, return true and write to the out parameters. Otherwise return + * false and leave the out parameters unmodified. + */ +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetArtBox(FPDF_PAGE page, + float* left, + float* bottom, + float* right, + float* top); + +/** * Apply transforms to |page|. * * If |matrix| is provided it will be applied to transform the page. |