summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorrbpotter <rbpotter@chromium.org>2017-07-11 10:04:29 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-07-11 17:22:12 +0000
commite8468c43cb3b14f4440456d19cb047150509949d (patch)
treec11fc22bfe770abf5321fceb32644dca5c34faa1 /fpdfsdk
parent00c3cfdbae074a379cab4edad0e4fa75d6127797 (diff)
downloadpdfium-e8468c43cb3b14f4440456d19cb047150509949d.tar.xz
Add Windows generic / text only printer driver support.
BUG=chromium:734850 Change-Id: Icc0947e2e99e77a36d8963fcf0b6d3deea161d3e Reviewed-on: https://pdfium-review.googlesource.com/7194 Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfview.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 1c282a744d..4d0845b616 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -37,6 +37,7 @@
#include "fpdfsdk/fsdk_define.h"
#include "fpdfsdk/fsdk_pauseadapter.h"
#include "fpdfsdk/javascript/ijs_runtime.h"
+#include "public/fpdf_edit.h"
#include "public/fpdf_ext.h"
#include "public/fpdf_progressive.h"
#include "third_party/base/allocator/partition_allocator/partition_alloc.h"
@@ -53,6 +54,16 @@
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
#include "core/fxge/cfx_windowsrenderdevice.h"
+
+// These checks are here because core/ and public/ cannot depend on each other.
+static_assert(WindowsPrintMode::kModeEmf == FPDF_PRINTMODE_EMF,
+ "WindowsPrintMode::kModeEmf value mismatch");
+static_assert(WindowsPrintMode::kModeTextOnly == FPDF_PRINTMODE_TEXTONLY,
+ "WindowsPrintMode::kModeTextOnly value mismatch");
+static_assert(WindowsPrintMode::kModePostScript2 == FPDF_PRINTMODE_POSTSCRIPT2,
+ "WindowsPrintMode::kModePostScript2 value mismatch");
+static_assert(WindowsPrintMode::kModePostScript3 == FPDF_PRINTMODE_POSTSCRIPT3,
+ "WindowsPrintMode::kModePostScript3 value mismatch");
#endif
namespace {
@@ -449,10 +460,10 @@ DLLEXPORT void STDCALL FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi) {
}
#endif // PDFIUM_PRINT_TEXT_WITH_GDI
-DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintPostscriptLevel(int postscript_level) {
- if (postscript_level != 0 && postscript_level != 2 && postscript_level != 3)
+DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintMode(int mode) {
+ if (mode < FPDF_PRINTMODE_EMF || mode > FPDF_PRINTMODE_POSTSCRIPT3)
return FALSE;
- g_pdfium_print_postscript_level = postscript_level;
+ g_pdfium_print_mode = mode;
return TRUE;
}
#endif // defined(_WIN32)