summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_view.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-25 21:10:05 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-25 21:10:05 +0000
commit9ed6bd7150a9333cb28d149c98e3d316c3ededdf (patch)
treed8b293aaec7be2acc7645150a194d9625a344758 /fpdfsdk/fpdf_view.cpp
parentd7f3f1e1b99f1e10bfce83d779303c678965b57c (diff)
downloadpdfium-9ed6bd7150a9333cb28d149c98e3d316c3ededdf.tar.xz
Add PostScript PASSTHROUGH options to FPDF_SetPrintMode().
The existing PostScript modes write data into EMF comments. This satisfies Chromium's use case, but other embedders want to write data out via ExtEscape() in PASSTHROUGH mode. BUG=pdfium:1068 Change-Id: I998035e99fbb84b16dcd244b750b476cecc3bd22 Reviewed-on: https://pdfium-review.googlesource.com/31299 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_view.cpp')
-rw-r--r--fpdfsdk/fpdf_view.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index 60be46b977..28e42a8e81 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -59,6 +59,12 @@ static_assert(WindowsPrintMode::kModePostScript2 == FPDF_PRINTMODE_POSTSCRIPT2,
"WindowsPrintMode::kModePostScript2 value mismatch");
static_assert(WindowsPrintMode::kModePostScript3 == FPDF_PRINTMODE_POSTSCRIPT3,
"WindowsPrintMode::kModePostScript3 value mismatch");
+static_assert(WindowsPrintMode::kModePostScript2PassThrough ==
+ FPDF_PRINTMODE_POSTSCRIPT2_PASSTHROUGH,
+ "WindowsPrintMode::kModePostScript2PassThrough value mismatch");
+static_assert(WindowsPrintMode::kModePostScript3PassThrough ==
+ FPDF_PRINTMODE_POSTSCRIPT3_PASSTHROUGH,
+ "WindowsPrintMode::kModePostScript3PassThrough value mismatch");
#endif
namespace {
@@ -210,8 +216,10 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi) {
#endif // PDFIUM_PRINT_TEXT_WITH_GDI
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_SetPrintMode(int mode) {
- if (mode < FPDF_PRINTMODE_EMF || mode > FPDF_PRINTMODE_POSTSCRIPT3)
+ if (mode < FPDF_PRINTMODE_EMF ||
+ mode > FPDF_PRINTMODE_POSTSCRIPT3_PASSTHROUGH) {
return FALSE;
+ }
g_pdfium_print_mode = static_cast<WindowsPrintMode>(mode);
return TRUE;
}