Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdfsdk_helpers.cpp File Reference

(0ccf980226462398d5097987466bcffd8236e1e9)

Include dependency graph for cpdfsdk_helpers.cpp:

Go to the source code of this file.

Functions

IPDF_PageIPDFPageFromFPDFPage (FPDF_PAGE page)
FPDF_PAGE FPDFPageFromIPDFPage (IPDF_Page *page)
CPDF_DocumentCPDFDocumentFromFPDFDocument (FPDF_DOCUMENT doc)
FPDF_DOCUMENT FPDFDocumentFromCPDFDocument (CPDF_Document *doc)
CPDF_PageCPDFPageFromFPDFPage (FPDF_PAGE page)
FXDIB_Format FXDIBFormatFromFPDFFormat (int format)
CPDFSDK_InteractiveFormFormHandleToInteractiveForm (FPDF_FORMHANDLE hHandle)
ByteString ByteStringFromFPDFWideString (FPDF_WIDESTRING wide_string)
WideString WideStringFromFPDFWideString (FPDF_WIDESTRING wide_string)
UNSAFE_BUFFER_USAGE pdfium::span< char > SpanFromFPDFApiArgs (void *buffer, pdfium::StrictNumeric< size_t > buflen)
RetainPtr< const CPDF_ArrayGetQuadPointsArrayFromDictionary (const CPDF_Dictionary *dict)
RetainPtr< CPDF_ArrayGetMutableQuadPointsArrayFromDictionary (CPDF_Dictionary *dict)
RetainPtr< CPDF_ArrayAddQuadPointsArrayToDictionary (CPDF_Dictionary *dict)
bool IsValidQuadPointsIndex (const CPDF_Array *array, size_t index)
bool GetQuadPointsAtIndex (RetainPtr< const CPDF_Array > array, size_t quad_index, FS_QUADPOINTSF *quad_points)
CFX_PointF CFXPointFFromFSPointF (const FS_POINTF &point)
CFX_FloatRect CFXFloatRectFromFSRectF (const FS_RECTF &rect)
FS_RECTF FSRectFFromCFXFloatRect (const CFX_FloatRect &rect)
CFX_Matrix CFXMatrixFromFSMatrix (const FS_MATRIX &matrix)
FS_MATRIX FSMatrixFromCFXMatrix (const CFX_Matrix &matrix)
unsigned long NulTerminateMaybeCopyAndReturnLength (const ByteString &text, pdfium::span< char > result_span)
unsigned long Utf16EncodeMaybeCopyAndReturnLength (const WideString &text, pdfium::span< char > result_span)
unsigned long GetRawStreamMaybeCopyAndReturnLength (RetainPtr< const CPDF_Stream > stream, pdfium::span< uint8_t > buffer)
unsigned long DecodeStreamMaybeCopyAndReturnLength (RetainPtr< const CPDF_Stream > stream, pdfium::span< uint8_t > buffer)
void SetPDFSandboxPolicy (FPDF_DWORD policy, FPDF_BOOL enable)
FPDF_BOOL IsPDFSandboxPolicyEnabled (FPDF_DWORD policy)
void SetPDFUnsupportInfo (UNSUPPORT_INFO *unsp_info)
void ReportUnsupportedFeatures (const CPDF_Document *pDoc)
void ReportUnsupportedXFA (const CPDF_Document *pDoc)
void CheckForUnsupportedAnnot (const CPDF_Annot *pAnnot)
void ProcessParseError (CPDF_Parser::Error err)
void SetColorFromScheme (const FPDF_COLORSCHEME *pColorScheme, CPDF_RenderOptions *pRenderOptions)
std::vector< uint32_t > ParsePageRangeString (const ByteString &bsPageRange, uint32_t nCount)

Function Documentation

◆ AddQuadPointsArrayToDictionary()

RetainPtr< CPDF_Array > AddQuadPointsArrayToDictionary ( CPDF_Dictionary * dict)

Definition at line 281 of file cpdfsdk_helpers.cpp.

◆ ByteStringFromFPDFWideString()

ByteString ByteStringFromFPDFWideString ( FPDF_WIDESTRING wide_string)

Definition at line 238 of file cpdfsdk_helpers.cpp.

References fxcrt::WideString::ToUTF8(), and WideStringFromFPDFWideString().

Referenced by FPDFAttachment_SetStringValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CFXFloatRectFromFSRectF()

CFX_FloatRect CFXFloatRectFromFSRectF ( const FS_RECTF & rect)

Definition at line 314 of file cpdfsdk_helpers.cpp.

References CFX_FloatRect::CFX_FloatRect().

Referenced by FPDF_RenderPageBitmapWithMatrix(), FPDFAnnot_SetRect(), and FPDFPage_TransFormWithClip().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CFXMatrixFromFSMatrix()

CFX_Matrix CFXMatrixFromFSMatrix ( const FS_MATRIX & matrix)

Definition at line 322 of file cpdfsdk_helpers.cpp.

References CFX_Matrix::CFX_Matrix().

Referenced by FPDF_RenderPageBitmapWithMatrix(), FPDFPage_TransFormWithClip(), FPDFPageObj_SetMatrix(), and FPDFPageObj_TransformF().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CFXPointFFromFSPointF()

CFX_PointF CFXPointFFromFSPointF ( const FS_POINTF & point)

Definition at line 310 of file cpdfsdk_helpers.cpp.

◆ CheckForUnsupportedAnnot()

void CheckForUnsupportedAnnot ( const CPDF_Annot * pAnnot)

Definition at line 434 of file cpdfsdk_helpers.cpp.

References CPDF_Annot::FILEATTACHMENT, CPDF_Annot::GetAnnotDict(), CPDF_Dictionary::GetByteStringFor(), CPDF_Annot::GetSubtype(), pdfium::form_fields::kFT, pdfium::form_fields::kSig, CPDF_Annot::MOVIE, fxcrt::ByteString::operator!=(), fxcrt::ByteString::operator==(), CPDF_Annot::RICHMEDIA, CPDF_Annot::SCREEN, CPDF_Annot::SOUND, CPDF_Annot::THREED, and CPDF_Annot::WIDGET.

Referenced by CPDFSDK_PageView::LoadFXAnnots().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CPDFDocumentFromFPDFDocument()

CPDF_Document * CPDFDocumentFromFPDFDocument ( FPDF_DOCUMENT doc)

Definition at line 205 of file cpdfsdk_helpers.cpp.

Referenced by FPDF_CopyViewerPreferences(), FPDF_CountNamedDests(), FPDF_DocumentHasValidCrossReferenceTable(), FPDF_GetDocPermissions(), FPDF_GetDocUserPermissions(), FPDF_GetFileIdentifier(), FPDF_GetFileVersion(), FPDF_GetFormType(), FPDF_GetMetaText(), FPDF_GetNamedDest(), FPDF_GetNamedDestByName(), FPDF_GetPageCount(), FPDF_GetPageLabel(), FPDF_GetPageSizeByIndexF(), FPDF_GetSecurityHandlerRevision(), FPDF_GetSignatureCount(), FPDF_GetSignatureObject(), FPDF_GetTrailerEnds(), FPDF_GetXFAPacketContent(), FPDF_GetXFAPacketCount(), FPDF_GetXFAPacketName(), FPDF_ImportNPagesToOne(), FPDF_ImportPages(), FPDF_ImportPagesByIndex(), FPDF_LoadPage(), FPDF_MovePages(), FPDF_NewXObjectFromPage(), FPDF_VIEWERREF_GetDuplex(), FPDF_VIEWERREF_GetName(), FPDF_VIEWERREF_GetNumCopies(), FPDF_VIEWERREF_GetPrintPageRange(), FPDF_VIEWERREF_GetPrintScaling(), FPDFAction_GetDest(), FPDFAction_GetURIPath(), FPDFAttachment_SetFile(), FPDFAvail_GetFirstPageNum(), FPDFBookmark_Find(), FPDFBookmark_GetDest(), FPDFBookmark_GetFirstChild(), FPDFBookmark_GetNextSibling(), FPDFCatalog_IsTagged(), FPDFCatalog_SetLanguage(), FPDFDest_GetDestPageIndex(), FPDFDoc_AddAttachment(), FPDFDoc_DeleteAttachment(), FPDFDoc_GetAttachment(), FPDFDoc_GetAttachmentCount(), FPDFDoc_GetJavaScriptAction(), FPDFDoc_GetJavaScriptActionCount(), FPDFDoc_GetPageMode(), FPDFDOC_InitFormFillEnvironment(), FPDFImageObj_GetRenderedBitmap(), FPDFLink_GetDest(), FPDFPage_Delete(), FPDFPage_New(), FPDFPageObj_CreateTextObj(), FPDFPageObj_NewImageObj(), FPDFPageObj_NewTextObj(), FPDFText_LoadCidType2Font(), FPDFText_LoadFont(), FPDFText_LoadStandardFont(), and FPDFTextObj_GetRenderedBitmap().

◆ CPDFPageFromFPDFPage()

CPDF_Page * CPDFPageFromFPDFPage ( FPDF_PAGE page)

Definition at line 213 of file cpdfsdk_helpers.cpp.

References IPDF_Page::AsPDFPage(), and IPDFPageFromFPDFPage().

Referenced by FORM_DoPageAAction(), FPDF_GetPageAAction(), FPDF_GetPageBoundingBox(), FPDF_RenderPage_Close(), FPDF_RenderPage_Continue(), FPDF_RenderPageBitmap(), FPDF_RenderPageBitmapWithColorScheme_Start(), FPDF_RenderPageBitmapWithMatrix(), FPDF_StructTree_GetForPage(), FPDFAnnot_GetFormFieldAtPoint(), FPDFImageObj_GetImageMetadata(), FPDFImageObj_GetRenderedBitmap(), FPDFImageObj_SetBitmap(), FPDFLink_Enumerate(), FPDFLink_GetAnnot(), FPDFLink_GetLinkAtPoint(), FPDFLink_GetLinkZOrderAtPoint(), FPDFPage_CountObjects(), FPDFPage_CreateAnnot(), FPDFPage_Flatten(), FPDFPage_FormFieldZOrderAtPoint(), FPDFPage_GenerateContent(), FPDFPage_GetAnnot(), FPDFPage_GetAnnotCount(), FPDFPage_GetAnnotIndex(), FPDFPage_GetArtBox(), FPDFPage_GetBleedBox(), FPDFPage_GetCropBox(), FPDFPage_GetMediaBox(), FPDFPage_GetObject(), FPDFPage_GetRotation(), FPDFPage_GetThumbnailAsBitmap(), FPDFPage_GetTrimBox(), FPDFPage_HasFormFieldAtPoint(), FPDFPage_HasTransparency(), FPDFPage_InsertClipPath(), FPDFPage_InsertObject(), FPDFPage_RemoveAnnot(), FPDFPage_RemoveObject(), FPDFPage_SetArtBox(), FPDFPage_SetBleedBox(), FPDFPage_SetCropBox(), FPDFPage_SetMediaBox(), FPDFPage_SetRotation(), FPDFPage_SetTrimBox(), FPDFPage_TransformAnnots(), FPDFPage_TransFormWithClip(), FPDFText_LoadPage(), FPDFTextObj_GetRenderedBitmap(), and TEST_F().

Here is the call graph for this function:

◆ DecodeStreamMaybeCopyAndReturnLength()

unsigned long DecodeStreamMaybeCopyAndReturnLength ( RetainPtr< const CPDF_Stream > stream,
pdfium::span< uint8_t > buffer )

Definition at line 354 of file cpdfsdk_helpers.cpp.

◆ FormHandleToInteractiveForm()

CPDFSDK_InteractiveForm * FormHandleToInteractiveForm ( FPDF_FORMHANDLE hHandle)

Definition at line 232 of file cpdfsdk_helpers.cpp.

References CPDFSDKFormFillEnvironmentFromFPDFFormHandle(), and CPDFSDK_FormFillEnvironment::GetInteractiveForm().

Referenced by FPDF_RemoveFormFieldHighlight(), FPDF_SetFormFieldHighlightAlpha(), FPDF_SetFormFieldHighlightColor(), FPDFAnnot_GetFormControlIndex(), FPDFAnnot_GetFormFieldAtPoint(), FPDFPage_FormFieldZOrderAtPoint(), and FPDFPage_HasFormFieldAtPoint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFDocumentFromCPDFDocument()

FPDF_DOCUMENT FPDFDocumentFromCPDFDocument ( CPDF_Document * doc)

Definition at line 209 of file cpdfsdk_helpers.cpp.

◆ FPDFPageFromIPDFPage()

FPDF_PAGE FPDFPageFromIPDFPage ( IPDF_Page * page)

Definition at line 201 of file cpdfsdk_helpers.cpp.

◆ FSMatrixFromCFXMatrix()

FS_MATRIX FSMatrixFromCFXMatrix ( const CFX_Matrix & matrix)

Definition at line 326 of file cpdfsdk_helpers.cpp.

References CFX_Matrix::a, CFX_Matrix::b, CFX_Matrix::c, CFX_Matrix::d, CFX_Matrix::e, and CFX_Matrix::f.

Referenced by FPDFPageObj_GetMatrix(), and FPDFText_GetMatrix().

Here is the caller graph for this function:

◆ FSRectFFromCFXFloatRect()

FS_RECTF FSRectFFromCFXFloatRect ( const CFX_FloatRect & rect)

Definition at line 318 of file cpdfsdk_helpers.cpp.

References CFX_FloatRect::bottom, CFX_FloatRect::left, CFX_FloatRect::right, and CFX_FloatRect::top.

Referenced by FPDFAnnot_GetRect(), and FPDFLink_GetAnnotRect().

Here is the caller graph for this function:

◆ FXDIBFormatFromFPDFFormat()

FXDIB_Format FXDIBFormatFromFPDFFormat ( int format)

Definition at line 217 of file cpdfsdk_helpers.cpp.

References k8bppRgb, kBgr, kBgra, kBgrx, and kInvalid.

Referenced by EmbedderTest::BytesPerPixelForFormat(), and FPDFBitmap_CreateEx().

Here is the caller graph for this function:

◆ GetMutableQuadPointsArrayFromDictionary()

RetainPtr< CPDF_Array > GetMutableQuadPointsArrayFromDictionary ( CPDF_Dictionary * dict)

Definition at line 275 of file cpdfsdk_helpers.cpp.

◆ GetQuadPointsArrayFromDictionary()

RetainPtr< const CPDF_Array > GetQuadPointsArrayFromDictionary ( const CPDF_Dictionary * dict)

Definition at line 270 of file cpdfsdk_helpers.cpp.

References CPDF_Dictionary::GetArrayFor().

Here is the call graph for this function:

◆ GetQuadPointsAtIndex()

bool GetQuadPointsAtIndex ( RetainPtr< const CPDF_Array > array,
size_t quad_index,
FS_QUADPOINTSF * quad_points )

Definition at line 289 of file cpdfsdk_helpers.cpp.

◆ GetRawStreamMaybeCopyAndReturnLength()

unsigned long GetRawStreamMaybeCopyAndReturnLength ( RetainPtr< const CPDF_Stream > stream,
pdfium::span< uint8_t > buffer )

Definition at line 347 of file cpdfsdk_helpers.cpp.

◆ IPDFPageFromFPDFPage()

IPDF_Page * IPDFPageFromFPDFPage ( FPDF_PAGE page)

Definition at line 197 of file cpdfsdk_helpers.cpp.

Referenced by CPDFPageFromFPDFPage(), FORM_DoPageAAction(), FORM_OnBeforeClosePage(), FPDF_ClosePage(), FPDF_DeviceToPage(), FPDF_GetPageHeightF(), FPDF_GetPageWidthF(), FPDF_PageToDevice(), FPDFLink_GetAnnot(), FPDFPage_CreateAnnot(), FPDFPage_GetAnnot(), and CPDFSDKBAAnnotTest::SetUpBAAnnot().

Here is the caller graph for this function:

◆ IsPDFSandboxPolicyEnabled()

FPDF_BOOL IsPDFSandboxPolicyEnabled ( FPDF_DWORD policy)

Definition at line 375 of file cpdfsdk_helpers.cpp.

Referenced by FPDF_CreateNewDocument(), and fxjs::FX_GetDateTime().

Here is the caller graph for this function:

◆ IsValidQuadPointsIndex()

bool IsValidQuadPointsIndex ( const CPDF_Array * array,
size_t index )

Definition at line 285 of file cpdfsdk_helpers.cpp.

◆ NulTerminateMaybeCopyAndReturnLength()

unsigned long NulTerminateMaybeCopyAndReturnLength ( const ByteString & text,
pdfium::span< char > result_span )

Definition at line 330 of file cpdfsdk_helpers.cpp.

◆ ParsePageRangeString()

std::vector< uint32_t > ParsePageRangeString ( const ByteString & bsPageRange,
uint32_t nCount )

Definition at line 508 of file cpdfsdk_helpers.cpp.

◆ ProcessParseError()

void ProcessParseError ( CPDF_Parser::Error err)

Definition at line 471 of file cpdfsdk_helpers.cpp.

References CPDF_Parser::FILE_ERROR, CPDF_Parser::FORMAT_ERROR, FXSYS_SetLastError(), CPDF_Parser::HANDLER_ERROR, CPDF_Parser::PASSWORD_ERROR, and CPDF_Parser::SUCCESS.

Here is the call graph for this function:

◆ ReportUnsupportedFeatures()

void ReportUnsupportedFeatures ( const CPDF_Document * pDoc)

Definition at line 390 of file cpdfsdk_helpers.cpp.

References CPDF_Document::GetRoot(), CPDF_Dictionary::KeyExist(), and fxcrt::ByteString::operator==().

Here is the call graph for this function:

◆ ReportUnsupportedXFA()

void ReportUnsupportedXFA ( const CPDF_Document * pDoc)

Definition at line 429 of file cpdfsdk_helpers.cpp.

References CPDF_Document::GetExtension().

Referenced by FPDFDOC_InitFormFillEnvironment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetColorFromScheme()

void SetColorFromScheme ( const FPDF_COLORSCHEME * pColorScheme,
CPDF_RenderOptions * pRenderOptions )

Definition at line 494 of file cpdfsdk_helpers.cpp.

References CPDF_RenderOptions::ColorScheme::path_fill_color, CPDF_RenderOptions::ColorScheme::path_stroke_color, CPDF_RenderOptions::SetColorScheme(), CPDF_RenderOptions::ColorScheme::text_fill_color, and CPDF_RenderOptions::ColorScheme::text_stroke_color.

Here is the call graph for this function:

◆ SetPDFSandboxPolicy()

void SetPDFSandboxPolicy ( FPDF_DWORD policy,
FPDF_BOOL enable )

Definition at line 361 of file cpdfsdk_helpers.cpp.

Referenced by FPDF_SetSandBoxPolicy().

Here is the caller graph for this function:

◆ SetPDFUnsupportInfo()

void SetPDFUnsupportInfo ( UNSUPPORT_INFO * unsp_info)

Definition at line 386 of file cpdfsdk_helpers.cpp.

Referenced by FSDK_SetUnSpObjProcessHandler().

Here is the caller graph for this function:

◆ SpanFromFPDFApiArgs()

UNSAFE_BUFFER_USAGE pdfium::span< char > SpanFromFPDFApiArgs ( void * buffer,
pdfium::StrictNumeric< size_t > buflen )

Definition at line 252 of file cpdfsdk_helpers.cpp.

◆ Utf16EncodeMaybeCopyAndReturnLength()

unsigned long Utf16EncodeMaybeCopyAndReturnLength ( const WideString & text,
pdfium::span< char > result_span )

Definition at line 338 of file cpdfsdk_helpers.cpp.

References fxcrt::WideString::ToUTF16LE().

Here is the call graph for this function:

◆ WideStringFromFPDFWideString()

WideString WideStringFromFPDFWideString ( FPDF_WIDESTRING wide_string)

Definition at line 244 of file cpdfsdk_helpers.cpp.

Referenced by ByteStringFromFPDFWideString(), FORM_ReplaceAndKeepSelection(), FORM_ReplaceSelection(), FPDFAnnot_AddFileAttachment(), FPDFAnnot_SetAP(), FPDFAnnot_SetStringValue(), FPDFBookmark_Find(), FPDFDoc_AddAttachment(), FPDFText_SetText(), and GetPlatformString().

Here is the caller graph for this function: