41class Q_PDF_EXPORT
QPdfDocumentPrivate:
public FPDF_FILEACCESS,
public FX_FILEAVAIL,
public FX_DOWNLOADHINTS
44 QPdfDocumentPrivate();
45 ~QPdfDocumentPrivate();
48 QPdfPageModel *pageModel =
nullptr;
54 QPointer<QIODevice> device;
55 QScopedPointer<QIODevice> ownDevice;
57 QPointer<QIODevice> sequentialSourceDevice;
60 QPdfDocument::Status status;
61 QPdfDocument::Error lastError;
66 void load(QIODevice *device,
bool ownDevice);
67 void loadAsync(QIODevice *device);
69 void _q_tryLoadingWithSizeFromContentHeader();
70 void initiateAsyncLoadWithTotalSizeKnown(quint64 totalSize);
71 void _q_copyFromSequentialSourceDevice();
72 void tryLoadDocument();
74 bool checkPageComplete(
int page);
75 void setStatus(QPdfDocument::Status status);
77 static FPDF_BOOL fpdf_IsDataAvail(
struct _FX_FILEAVAIL* pThis, size_t offset, size_t size);
78 static int fpdf_GetBlock(
void* param,
unsigned long position,
unsigned char* pBuf,
unsigned long size);
79 static void fpdf_AddSegment(
struct _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size);
80 void updateLastError();
81 QString getText(FPDF_TEXTPAGE textPage,
int startIndex,
int count)
const;
82 QPointF getCharPosition(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage,
int charIndex)
const;
83 QRectF getCharBox(FPDF_PAGE pdfPage, FPDF_TEXTPAGE textPage,
int charIndex)
const;
84 QPointF mapPageToView(FPDF_PAGE pdfPage,
double x,
double y)
const;
85 QRectF mapPageToView(FPDF_PAGE pdfPage,
double left,
double top,
double right,
double bottom)
const;
86 QPointF mapViewToPage(FPDF_PAGE pdfPage, QPointF position)
const;
95 CounterClockWise90 = 3
98 static constexpr QFPDFRotation toFPDFRotation(QPdfDocumentRenderOptions::Rotation rotation)
101 case QPdfDocumentRenderOptions::Rotation::None:
102 return QFPDFRotation::Normal;
103 case QPdfDocumentRenderOptions::Rotation::Clockwise90:
104 return QFPDFRotation::ClockWise90;
105 case QPdfDocumentRenderOptions::Rotation::Clockwise180:
106 return QFPDFRotation::ClockWise180;
107 case QPdfDocumentRenderOptions::Rotation::Clockwise270:
108 return QFPDFRotation::CounterClockWise90;
113 struct TextPosition {
118 TextPosition hitTest(
int page, QPointF position);