DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document) { CPDF_Document* pDoc = (CPDF_Document*)document; if (!pDoc) return TRUE; CPDF_ViewerPreferences viewRef(pDoc); return viewRef.PrintScaling(); }
DLLEXPORT FPDF_PAGERANGE STDCALL FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document) { CPDF_Document* pDoc = (CPDF_Document*)document; if (!pDoc) return NULL; CPDF_ViewerPreferences viewRef(pDoc); return viewRef.PrintPageRange(); }
DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document) { CPDF_Document* pDoc = (CPDF_Document*)document; if (!pDoc) return 1; CPDF_ViewerPreferences viewRef(pDoc); return viewRef.NumCopies(); }
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) { CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page); if (!pPDFPage) return nullptr; #ifdef PDF_ENABLE_XFA CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; CPDFXFA_Document* pDoc = pPage->GetDocument(); CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc()); #else // PDF_ENABLE_XFA CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument); #endif // PDF_ENABLE_XFA CPDF_TextPage* textpage = new CPDF_TextPage( pPDFPage, viewRef.IsDirectionR2L() ? FPDFText_Direction::Right : FPDFText_Direction::Left); textpage->ParseTextPage(); return textpage; }
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) { if (!page) return NULL; IPDF_TextPage* textpage = NULL; CPDF_ViewerPreferences viewRef(((CPDF_Page*)page)->m_pDocument); textpage = IPDF_TextPage::CreateTextPage((CPDF_Page*)page, viewRef.IsDirectionR2L()); textpage->ParseTextPage(); return textpage; }
DLLEXPORT FPDF_DUPLEXTYPE STDCALL FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document) { CPDF_Document* pDoc = (CPDF_Document*)document; if (!pDoc) return DuplexUndefined; CPDF_ViewerPreferences viewRef(pDoc); CFX_ByteString duplex = viewRef.Duplex(); if (FX_BSTRC("Simplex") == duplex) return Simplex; if (FX_BSTRC("DuplexFlipShortEdge") == duplex) return DuplexFlipShortEdge; if (FX_BSTRC("DuplexFlipLongEdge") == duplex) return DuplexFlipLongEdge; return DuplexUndefined; }