24 #include <QReadWriteLock>
27 #include "HOCRDocument.h"
28 #include "JBIG2Document.h"
29 #include "paperSize.h"
30 #include "resolution.h"
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 and interprets HOCR files, the standard output file format for Optical Character Recognition sy...
Text box, as defined in an HOCR file.
Reads, writes and renders JBIG2 files, and chops them into pieces for inclusion into a PDF document.
Simple generator for PDF/A-2b compliant documents.
void setPageSize(const paperSize &size)
Sets page size, effective for future calls of the methods addPage()
void setResolutionOverride(resolution horizontal, resolution vertical)
Sets graphic resolution for future calls of the methods addPage()
void setSubject(const QString &subject)
Set the subject string in the PDF/A meta data.
void setResolutionOverrideVertical(resolution vertical)
Set vertical resolution.
void subjectChanged()
Emitted when subject changes.
QStringList autoOCRLanguages()
List of languages used for OCR.
void waitForWorkerThreads()
Waits for all worker threads to finish.
void setResolutionOverrideHorizontal(resolution horizontal)
Set horizontal resolution.
void pageSizeChanged()
Emitted when pageSize changes.
void resolutionOverrideVerticalChanged()
Emitted when resolutionOverrideVertical changes.
void progress(qreal percentage)
Progress indicator.
QString setAutoOCRLanguages(const QStringList &OCRLanguages)
Specify languages used by the tesseract OCR engine.
void setAutoOCR(bool autoOCR)
Specify if the tesseract OCR engine should be run automatically.
void clearOCRData()
Delete all pages from the internal HOCRDocument.
void resolutionOverrideHorizontalChanged()
Emitted when resolutionOverrideHorizontal changes.
void autoOCRLanguagesChanged()
Emitted when autoOCRLanguages change.
void setResolutionOverride(resolution res)
Overloaded method that sets horizontal and vertical resolution to the same value.
paperSize pageSize()
Page Size.
QString title()
Metadata: Title String.
void titleChanged()
Emitted when title changes.
void setPageSize(paperSize::format size=paperSize::empty)
Sets page size, effective for future calls of the methods addPage()
resolution resolutionOverrideHorizontal()
Horizontal resolution.
QString addPages(const QString &imageFileName, QStringList *warnings=0)
Add images to the PDF document.
void setTitle(const QString &title)
Set the title string in the PDF/A meta data.
void finished()
Emitted just before waitForWorkerThreads() returns.
QString addPages(const JBIG2Document &jbig2doc, QStringList *warnings=0)
Add JBIG2 images to the PDF document.
QString keywords()
Metadata: Keywords.
void authorChanged()
Emitted when author changes.
void setAuthor(const QString &author)
Set the author string in the PDF/A meta data.
HOCRDocument OCRData()
Return a copy of the internal HOCRDocument.
PDFAWriter(bool bestCompression=false)
Constructor.
QString addPages(const QImage &image, QStringList *warnings=0)
Add an image to the PDF document.
void autoOCRChanged()
Emitted when autoOCR changes.
QString author()
Metadata: Author.
void keywordsChanged()
Emitted when keywords change.
QString subject()
Metadata: Subject string.
void clearResolutionOverride()
Set horizontal and vertical override resolution to zero.
resolution resolutionOverrideVertical()
Vertical resolution.
void setKeywords(const QString &keywords)
Set the author string in the PDF/A meta data.
void appendToOCRData(const HOCRDocument &doc)
Specify pre-processed OCR data.
Trivial class to store elementary info about bitmap graphics.
The length stores a length and converts between units.
The paperSize class identifies and stores paper sizes.
format
List of supported standard sizes.
The resolution class stores a resolution and converts between units.