24 #include <QReadWriteLock> 27 #include "HOCRDocument.h" 28 #include "JBIG2Document.h" 29 #include "paperSize.h" 30 #include "resolution.h" 168 explicit PDFAWriter(
bool bestCompression=
false);
213 void setTitle(
const QString &title);
396 QString
addPages(
const QImage &image, QStringList *warnings=0);
487 QString
addPages(
const QString &imageFileName, QStringList *warnings=0);
500 operator QByteArray();
569 QString _author, _keywords, _subject, _title;
576 QStringList OCRLanguages;
591 QString addJBIG2(
const QString &fileName, QStringList *warnings=0);
601 QString addJPEG(
const QString &fileName);
612 QString addJPX(
const QString &fileName);
618 QString addTIFF(
const QString &fileName);
624 void addGFXPage(quint32 graphicObjectIndex,
const imageInfo& bInfo,
const QImage& imageForOCR = QImage());
633 protoObject(QByteArray _data) : data(_data) {
638 protoObject(QFuture<QByteArray> _future) : future(_future) {
642 inline operator QByteArray() {
643 if (!future.isCanceled()) {
644 data = future.result();
645 future = QFuture<QByteArray>();
652 QFuture<QByteArray> future;
656 QList<protoObject> objects;
659 quint32 catalogObjectIndex;
660 quint32 metaDataObjectIndex;
661 quint32 infoObjectIndex;
662 quint32 pageDirectoryObjectIndex;
663 quint32 colorProfileObjectIndex;
664 quint32 fontObjectIndex;
667 bool bestCompression;
670 QList<quint32> pageIndices;
673 static QByteArray readFile(
const QString& fileName);
676 QByteArray generatePageDirectoryObject()
const;
680 static QByteArray generateStreamObject(
const QByteArray &input);
683 quint32 getFontObjectIndex();
688 static QByteArray createImageObject_bw_G4(
const QImage &image);
693 static QByteArray createImageObject_bitonal_G4(
const QImage &image);
698 static QByteArray createImageObject_gray_zlib(
const QImage &image,
bool bestCompression);
703 static QByteArray createImageObject_indexed_zlib(
const QImage &image,
bool bestCompression);
708 static QByteArray createImageObject_rgb_zlib(
const QImage &image,
bool bestCompression);
717 static QByteArray completePageContentObject_b(QByteArray contentStream,
const imageInfo& bInfo,
length deltaX,
length deltaY,
const QImage& image,
const QStringList& OCRLanguages);
Reads, writes and renders JBIG2 files, and chops them into pieces for inclusion into a PDF document...
void progress(qreal percentage)
Progress indicator.
PDFAWriter(bool bestCompression=false)
Constructor.
void appendToOCRData(const HOCRDocument &doc)
Specify pre-processed OCR data.
void setAuthor(const QString &author)
Set the author string in the PDF/A meta data.
void keywordsChanged()
Emitted when keywords change.
void setResolutionOverride(resolution res)
Overloaded method that sets horizontal and vertical resolution to the same value. ...
void setSubject(const QString &subject)
Set the subject string in the PDF/A meta data.
void setAutoOCR(bool autoOCR)
Specify if the tesseract OCR engine should be run automatically.
void setResolutionOverride(resolution horizontal, resolution vertical)
Sets graphic resolution for future calls of the methods addPage()
void setPageSize(const paperSize &size)
Sets page size, effective for future calls of the methods addPage()
The resolution class stores a resolution and converts between units.
Trivial class to store elementary info about bitmap graphics.
void resolutionOverrideHorizontalChanged()
Emitted when resolutionOverrideHorizontal changes.
void resolutionOverrideVerticalChanged()
Emitted when resolutionOverrideVertical changes.
QString author()
Metadata: Author.
void clearResolutionOverride()
Set horizontal and vertical override resolution to zero.
void autoOCRLanguagesChanged()
Emitted when autoOCRLanguages change.
void titleChanged()
Emitted when title changes.
void setKeywords(const QString &keywords)
Set the author string in the PDF/A meta data.
QString setAutoOCRLanguages(const QStringList &OCRLanguages)
Specify languages used by the tesseract OCR engine.
Text box, as defined in an HOCR file.
void authorChanged()
Emitted when author changes.
void setResolutionOverrideHorizontal(resolution horizontal)
Set horizontal resolution.
The length stores a length and converts between units.
paperSize pageSize()
Page Size.
QStringList autoOCRLanguages()
List of languages used for OCR.
void waitForWorkerThreads()
Waits for all worker threads to finish.
resolution resolutionOverrideHorizontal()
Horizontal resolution.
Simple generator for PDF/A-2b compliant documents.
void setTitle(const QString &title)
Set the title string in the PDF/A meta data.
void clearOCRData()
Delete all pages from the internal HOCRDocument.
The paperSize class identifies and stores paper sizes.
QString keywords()
Metadata: Keywords.
void setResolutionOverrideVertical(resolution vertical)
Set vertical resolution.
void subjectChanged()
Emitted when subject changes.
void pageSizeChanged()
Emitted when pageSize changes.
HOCRDocument OCRData()
Return a copy of the internal HOCRDocument.
QString subject()
Metadata: Subject string.
Reads and interprets HOCR files, the standard output file format for Optical Character Recognition sy...
void autoOCRChanged()
Emitted when autoOCR changes.
format
List of supported standard sizes.
QString title()
Metadata: Title String.
QString addPages(const QImage &image, QStringList *warnings=0)
Add an image to the PDF document.
resolution resolutionOverrideVertical()
Vertical resolution.
void finished()
Emitted just before waitForWorkerThreads() returns.