Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2701)

Unified Diff: fpdfsdk/fpdfview.cpp

Issue 2612243005: Add postscript path (Closed)
Patch Set: Get rid of extra declarations Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxge/win32/fx_win32_print.cpp ('k') | public/fpdfview.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfview.cpp
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index c292384e88ba5f42ae4e7ca4c1827da5a46089bd..ff4d46e357705e22dbd522d04cd918bb078b36a3 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -429,7 +429,8 @@ DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy,
return FSDK_SetSandBoxPolicy(policy, enable);
}
-#if defined(_WIN32) && defined(PDFIUM_PRINT_TEXT_WITH_GDI)
+#if defined(_WIN32)
+#if defined(PDFIUM_PRINT_TEXT_WITH_GDI)
DLLEXPORT void STDCALL
FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func) {
g_pdfium_typeface_accessible_func = func;
@@ -438,7 +439,15 @@ FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func) {
DLLEXPORT void STDCALL FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi) {
g_pdfium_print_text_with_gdi = !!use_gdi;
}
-#endif
+#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)
+ return FALSE;
+ g_pdfium_print_postscript_level = postscript_level;
+ return TRUE;
+}
+#endif // defined(_WIN32)
DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
FPDF_BYTESTRING password) {
@@ -656,6 +665,9 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc,
pPage->SetRenderContext(pdfium::WrapUnique(pContext));
std::unique_ptr<CFX_DIBitmap> pBitmap;
+ // TODO: This results in unnecessary rasterization of some PDFs due to
+ // HasImageMask() returning true. If any image on the page is a mask, the
+ // entire page gets rasterized and the spool size gets huge.
const bool bNewBitmap =
pPage->BackgroundAlphaNeeded() || pPage->HasImageMask();
if (bNewBitmap) {
« no previous file with comments | « core/fxge/win32/fx_win32_print.cpp ('k') | public/fpdfview.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698