From fdb35ffb8d4bd283dd8f5905936f5c400fea3394 Mon Sep 17 00:00:00 2001 From: thestig Date: Mon, 18 Jul 2016 13:45:44 -0700 Subject: Implement CGdiPrinterDriver::DrawDeviceText(). This is sufficient to print text with GDI for PDFs generated by Chromium and cannot print any arbitrary PDF. Text that cannot be printed will be drawn as glyphs as before. BUG=409472 Review-Url: https://codereview.chromium.org/2113563003 --- fpdfsdk/fpdfview.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 646fb46f72..34e7d23619 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -334,6 +334,17 @@ DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, return FSDK_SetSandBoxPolicy(policy, enable); } +#if defined(_WIN32) && defined(PDFIUM_PRINT_TEXT_WITH_GDI) +DLLEXPORT void STDCALL +FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func) { + g_pdfium_typeface_accessible_func = func; +} + +DLLEXPORT void STDCALL FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi) { + g_pdfium_print_text_with_gdi = !!use_gdi; +} +#endif + DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password) { // NOTE: the creation of the file needs to be by the embedder on the -- cgit v1.2.3