Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include "fpdfsdk/cpdfsdk_helpers.h"
#include <utility>
#include "build/build_config.h"
#include "constants/form_fields.h"
#include "constants/stream_dict_common.h"
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fpdfapi/render/cpdf_renderoptions.h"
#include "core/fpdfdoc/cpdf_annot.h"
#include "core/fpdfdoc/cpdf_interactiveform.h"
#include "core/fpdfdoc/cpdf_metadata.h"
#include "core/fxcrt/span_util.h"
#include "core/fxcrt/unowned_ptr.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "third_party/base/check.h"
#include "third_party/base/numerics/safe_conversions.h"
Go to the source code of this file.
RetainPtr< CPDF_Array > AddQuadPointsArrayToDictionary | ( | CPDF_Dictionary * | dict | ) |
Definition at line 235 of file cpdfsdk_helpers.cpp.
ByteString ByteStringFromFPDFWideString | ( | FPDF_WIDESTRING | wide_string | ) |
Definition at line 208 of file cpdfsdk_helpers.cpp.
References fxcrt::WideString::ToUTF8(), and WideStringFromFPDFWideString().
Referenced by FPDFAttachment_SetStringValue().
CFX_FloatRect CFXFloatRectFromFSRectF | ( | const FS_RECTF & | rect | ) |
Definition at line 268 of file cpdfsdk_helpers.cpp.
References CFX_FloatRect::CFX_FloatRect().
Referenced by FPDF_RenderPageBitmapWithMatrix(), FPDFAnnot_SetRect(), and FPDFPage_TransFormWithClip().
CFX_Matrix CFXMatrixFromFSMatrix | ( | const FS_MATRIX & | matrix | ) |
Definition at line 276 of file cpdfsdk_helpers.cpp.
References CFX_Matrix::CFX_Matrix().
Referenced by FPDF_RenderPageBitmapWithMatrix(), FPDFPage_TransFormWithClip(), and FPDFPageObj_SetMatrix().
CFX_PointF CFXPointFFromFSPointF | ( | const FS_POINTF & | point | ) |
Definition at line 264 of file cpdfsdk_helpers.cpp.
void CheckForUnsupportedAnnot | ( | const CPDF_Annot * | pAnnot | ) |
Definition at line 392 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().
CPDF_Document * CPDFDocumentFromFPDFDocument | ( | FPDF_DOCUMENT | doc | ) |
Definition at line 190 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(), 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_LoadFont(), FPDFText_LoadStandardFont(), and FPDFTextObj_GetRenderedBitmap().
Definition at line 198 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().
unsigned long DecodeStreamMaybeCopyAndReturnLength | ( | RetainPtr< const CPDF_Stream > | stream, |
pdfium::span< uint8_t > | buffer ) |
Definition at line 312 of file cpdfsdk_helpers.cpp.
CPDFSDK_InteractiveForm * FormHandleToInteractiveForm | ( | FPDF_FORMHANDLE | hHandle | ) |
Definition at line 202 of file cpdfsdk_helpers.cpp.
References CPDFSDKFormFillEnvironmentFromFPDFFormHandle(), and CPDFSDK_FormFillEnvironment::GetInteractiveForm().
Referenced by FPDF_RemoveFormFieldHighlight(), FPDF_SetFormFieldHighlightAlpha(), FPDF_SetFormFieldHighlightColor(), FPDFAnnot_GetFontSize(), FPDFAnnot_GetFormControlIndex(), FPDFAnnot_GetFormFieldAtPoint(), FPDFPage_FormFieldZOrderAtPoint(), and FPDFPage_HasFormFieldAtPoint().
FPDF_DOCUMENT FPDFDocumentFromCPDFDocument | ( | CPDF_Document * | doc | ) |
Definition at line 194 of file cpdfsdk_helpers.cpp.
Definition at line 186 of file cpdfsdk_helpers.cpp.
FS_MATRIX FSMatrixFromCFXMatrix | ( | const CFX_Matrix & | matrix | ) |
Definition at line 280 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().
FS_RECTF FSRectFFromCFXFloatRect | ( | const CFX_FloatRect & | rect | ) |
Definition at line 272 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().
RetainPtr< CPDF_Array > GetMutableQuadPointsArrayFromDictionary | ( | CPDF_Dictionary * | dict | ) |
Definition at line 229 of file cpdfsdk_helpers.cpp.
RetainPtr< const CPDF_Array > GetQuadPointsArrayFromDictionary | ( | const CPDF_Dictionary * | dict | ) |
Definition at line 224 of file cpdfsdk_helpers.cpp.
References CPDF_Dictionary::GetArrayFor().
bool GetQuadPointsAtIndex | ( | RetainPtr< const CPDF_Array > | array, |
size_t | quad_index, | ||
FS_QUADPOINTSF * | quad_points ) |
Definition at line 243 of file cpdfsdk_helpers.cpp.
unsigned long GetRawStreamMaybeCopyAndReturnLength | ( | RetainPtr< const CPDF_Stream > | stream, |
pdfium::span< uint8_t > | buffer ) |
Definition at line 305 of file cpdfsdk_helpers.cpp.
Definition at line 182 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 CPDFSDK_BAAnnotTest::SetUpBAAnnot().
FPDF_BOOL IsPDFSandboxPolicyEnabled | ( | FPDF_DWORD | policy | ) |
Definition at line 333 of file cpdfsdk_helpers.cpp.
Referenced by FPDF_CreateNewDocument(), and fxjs::FX_GetDateTime().
bool IsValidQuadPointsIndex | ( | const CPDF_Array * | array, |
size_t | index ) |
Definition at line 239 of file cpdfsdk_helpers.cpp.
unsigned long NulTerminateMaybeCopyAndReturnLength | ( | const ByteString & | text, |
void * | buffer, | ||
unsigned long | buflen ) |
Definition at line 284 of file cpdfsdk_helpers.cpp.
References fxcrt::ByteString::c_str().
Referenced by FPDFAction_GetFilePath(), FPDFImageObj_GetImageFilter(), and FPDFSignatureObj_GetSubFilter().
std::vector< uint32_t > ParsePageRangeString | ( | const ByteString & | bsPageRange, |
uint32_t | nCount ) |
Definition at line 466 of file cpdfsdk_helpers.cpp.
void ProcessParseError | ( | CPDF_Parser::Error | err | ) |
Definition at line 429 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.
Referenced by FPDFAvail_GetDocument().
void ReportUnsupportedFeatures | ( | const CPDF_Document * | pDoc | ) |
Definition at line 348 of file cpdfsdk_helpers.cpp.
References CPDF_Document::GetRoot(), CPDF_Dictionary::KeyExist(), and fxcrt::ByteString::operator==().
void ReportUnsupportedXFA | ( | const CPDF_Document * | pDoc | ) |
Definition at line 387 of file cpdfsdk_helpers.cpp.
References CPDF_Document::GetExtension().
Referenced by FPDFDOC_InitFormFillEnvironment().
void SetColorFromScheme | ( | const FPDF_COLORSCHEME * | pColorScheme, |
CPDF_RenderOptions * | pRenderOptions ) |
Definition at line 452 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.
void SetPDFSandboxPolicy | ( | FPDF_DWORD | policy, |
FPDF_BOOL | enable ) |
Definition at line 319 of file cpdfsdk_helpers.cpp.
Referenced by FPDF_SetSandBoxPolicy().
void SetPDFUnsupportInfo | ( | UNSUPPORT_INFO * | unsp_info | ) |
Definition at line 344 of file cpdfsdk_helpers.cpp.
Referenced by FSDK_SetUnSpObjProcessHandler().
unsigned long Utf16EncodeMaybeCopyAndReturnLength | ( | const WideString & | text, |
void * | buffer, | ||
unsigned long | buflen ) |
Definition at line 294 of file cpdfsdk_helpers.cpp.
References fxcrt::ByteString::c_str(), and fxcrt::WideString::ToUTF16LE().
Referenced by FORM_GetFocusedText(), FORM_GetSelectedText(), FPDF_GetMetaText(), FPDFAnnot_GetFormAdditionalActionJavaScript(), FPDFAnnot_GetFormFieldAlternateName(), FPDFAnnot_GetFormFieldExportValue(), FPDFAnnot_GetFormFieldName(), FPDFAnnot_GetFormFieldValue(), FPDFAnnot_GetOptionLabel(), FPDFAnnot_GetStringValue(), FPDFAttachment_GetName(), FPDFAttachment_GetStringValue(), FPDFBookmark_GetTitle(), and FPDFTextObj_GetText().
WideString WideStringFromFPDFWideString | ( | FPDF_WIDESTRING | wide_string | ) |
Definition at line 212 of file cpdfsdk_helpers.cpp.
References fxcrt::WideString::FromUTF16LE().
Referenced by ByteStringFromFPDFWideString(), FORM_ReplaceAndKeepSelection(), FORM_ReplaceSelection(), FPDFAnnot_SetAP(), FPDFAnnot_SetStringValue(), FPDFBookmark_Find(), FPDFDoc_AddAttachment(), FPDFText_SetText(), and GetPlatformString().