diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-01-04 11:54:18 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-04 19:45:11 +0000 |
commit | de3f3fc5e16a2ee4fad2bdc0cda9e2ce73fd4fe3 (patch) | |
tree | debf6885600821ca264fb69957258fdbf767bb43 /public/fpdf_doc.h | |
parent | cb6c8d4ec4781c7db8448f2b4d9a8af879cf014e (diff) | |
download | pdfium-de3f3fc5e16a2ee4fad2bdc0cda9e2ce73fd4fe3.tar.xz |
Open FPDFDest_GetView API.
FPDFDest_GetView returns the view fit type and the parameters of the
view for a given destination.
This is useful to have more precise internal links and bookmarks that
are able to manipulate the viewport position and zoom level to focus
on the part of the PDF that it links to.
Bug: 55776, 535978, 748852
Change-Id: Ibf7df40a852030d75ec78cec7662380319569850
Reviewed-on: https://pdfium-review.googlesource.com/21790
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'public/fpdf_doc.h')
-rw-r--r-- | public/fpdf_doc.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/public/fpdf_doc.h b/public/fpdf_doc.h index 0f87361b38..93efa7ae98 100644 --- a/public/fpdf_doc.h +++ b/public/fpdf_doc.h @@ -25,6 +25,17 @@ extern "C" { // Launch an application or open a file. #define PDFACTION_LAUNCH 4 +// View destination fit types. See pdfmark reference v9, page 48. +#define PDFDEST_VIEW_UNKNOWN_MODE 0 +#define PDFDEST_VIEW_XYZ 1 +#define PDFDEST_VIEW_FIT 2 +#define PDFDEST_VIEW_FITH 3 +#define PDFDEST_VIEW_FITV 4 +#define PDFDEST_VIEW_FITR 5 +#define PDFDEST_VIEW_FITB 6 +#define PDFDEST_VIEW_FITBH 7 +#define PDFDEST_VIEW_FITBV 8 + typedef struct _FS_QUADPOINTSF { FS_FLOAT x1; FS_FLOAT y1; @@ -175,6 +186,22 @@ FPDFAction_GetURIPath(FPDF_DOCUMENT document, FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest); +// Get the view (fit type) specified by |dest|. +// Experimental API. Subject to change. +// +// document - handle to the document. +// dest - handle to the destination. +// outNumParams - buffer to write the number of view parameters. +// outParams - buffer to write the view parameters. Must be at least 4 +// FS_FLOATs long. +// Returns one of the PDFDEST_VIEW_* constants, PDFDEST_VIEW_UNKNOWN_MODE if +// |dest| does not specify a view. +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFDest_GetView(FPDF_DOCUMENT document, + FPDF_DEST dest, + unsigned long* outNumParams, + FS_FLOAT* outParams); + // Get the (x, y, zoom) location of |dest| in the destination page, if the // destination is in [page /XYZ x y zoom] syntax. // |