summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-18 21:39:40 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-18 21:39:40 +0000
commit0e5bab1b8402b65fa09a36a2b141bbf22291f822 (patch)
treee6d714f10fc9c552ea043073d17047f969f28f13 /samples
parentae2aec8712aa4c52454737467869b9d256baa05f (diff)
downloadpdfium-0e5bab1b8402b65fa09a36a2b141bbf22291f822.tar.xz
Remove PrintParams object.
The only way to theoretically get one is via doc.getPrintParams(), and it always returns in error. Even if one were returend to JS, there aren't any methods/callbacks to change its properties. Even if there were methods to change its properties, the information it stores doesn't align with what is in the JS spec for this object. Even if it were aligned with the JS spec, the way we check for its presence as the ninth parameter in CJS_Document::print() doesn't match the way its use is documented in the spec as the sole first parameter. Instead implement the older, simpler behaviour as spec'd prior to 6.0, and toss this enhancement altogether. Move function to check the result of ExpandKeywordParams() to js_define.h so other files can use it. Update comment in that file to remove reference to deprecated enum. Expand test for API and introduce callback to log parameters. Change-Id: I047e2be0d2afbad91d6b58c6c74bbea083fed330 Reviewed-on: https://pdfium-review.googlesource.com/c/44271 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/pdfium_test.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index e64382c911..c5c298d23e 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -219,6 +219,19 @@ void ExampleDocMail(IPDF_JSPLATFORM*,
GetPlatformWString(BCC).c_str(), GetPlatformWString(Subject).c_str(),
GetPlatformWString(Msg).c_str());
}
+
+void ExampleDocPrint(IPDF_JSPLATFORM*,
+ FPDF_BOOL bUI,
+ int nStart,
+ int nEnd,
+ FPDF_BOOL bSilent,
+ FPDF_BOOL bShrinkToFit,
+ FPDF_BOOL bPrintAsImage,
+ FPDF_BOOL bReverse,
+ FPDF_BOOL bAnnotations) {
+ printf("Doc Print: %d, %d, %d, %d, %d, %d, %d, %d\n", bUI, nStart, nEnd,
+ bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotations);
+}
#endif // PDF_ENABLE_V8
void ExampleUnsupportedHandler(UNSUPPORT_INFO*, int type) {
@@ -724,6 +737,7 @@ void RenderPdf(const std::string& name,
platform_callbacks.app_beep = ExampleAppBeep;
platform_callbacks.Doc_gotoPage = ExampleDocGotoPage;
platform_callbacks.Doc_mail = ExampleDocMail;
+ platform_callbacks.Doc_print = ExampleDocPrint;
#endif // PDF_ENABLE_V8
FPDF_FORMFILLINFO_PDFiumTest form_callbacks = {};