From 33472428e9a58fb45aeaf2c3d407eb1aa0681a1f Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Mon, 6 Apr 2020 19:58:46 +0200 Subject: [PATCH] Stamp annotation graphics --- CodeGenerator/codegenerator.h | 3 +- PdfExampleGenerator/pdfexamplesgenerator.cpp | 17 + PdfForQtLib/sources/pdfannotation.cpp | 142 +++++- PdfForQtLib/sources/pdfannotation.h | 37 +- PdfForQtLib/sources/pdfdocumentbuilder.cpp | 224 ++++++-- PdfForQtLib/sources/pdfdocumentbuilder.h | 36 +- generated_code_definition.xml | 507 +++++++++++++------ 7 files changed, 707 insertions(+), 259 deletions(-) diff --git a/CodeGenerator/codegenerator.h b/CodeGenerator/codegenerator.h index 324140b..3c00b75 100644 --- a/CodeGenerator/codegenerator.h +++ b/CodeGenerator/codegenerator.h @@ -153,7 +153,8 @@ public: _LinkHighlightMode, _TextAlignment, _AnnotationLineEnding, - _AnnotationBorderStyle + _AnnotationBorderStyle, + _Stamp }; Q_ENUM(DataType) diff --git a/PdfExampleGenerator/pdfexamplesgenerator.cpp b/PdfExampleGenerator/pdfexamplesgenerator.cpp index a76eb02..6ca8d0f 100644 --- a/PdfExampleGenerator/pdfexamplesgenerator.cpp +++ b/PdfExampleGenerator/pdfexamplesgenerator.cpp @@ -273,6 +273,23 @@ void PDFExamplesGenerator::generateAnnotationsExample() builder.createAnnotationInk(page13, polygons, 2.0, Qt::red, "Title", "Subject", "Contents"); } + pdf::PDFObjectReference page14 = builder.appendPage(QRectF(0, 0, 400, 400)); + builder.createAnnotationStamp(page14, QRectF(10, 50, 100, 50), pdf::Stamp::Approved, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(10, 100, 100, 50), pdf::Stamp::AsIs, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(10, 150, 100, 50), pdf::Stamp::Confidential, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(10, 200, 100, 50), pdf::Stamp::Departmental, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(10, 250, 100, 50), pdf::Stamp::Draft, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(10, 300, 100, 50), pdf::Stamp::Experimental, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(10, 350, 100, 50), pdf::Stamp::Expired, "Title", "Subject", "Contents"); + + builder.createAnnotationStamp(page14, QRectF(210, 50, 100, 50), pdf::Stamp::Final, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(210, 100, 100, 50), pdf::Stamp::ForComment, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(210, 150, 100, 50), pdf::Stamp::ForPublicRelease, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(210, 200, 100, 50), pdf::Stamp::NotApproved, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(210, 250, 100, 50), pdf::Stamp::NotForPublicRelease, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(210, 300, 100, 50), pdf::Stamp::Sold, "Title", "Subject", "Contents"); + builder.createAnnotationStamp(page14, QRectF(210, 350, 100, 50), pdf::Stamp::TopSecret, "Title", "Subject", "Contents"); + // Write result to a file pdf::PDFDocument document = builder.build(); pdf::PDFDocumentWriter writer(nullptr); diff --git a/PdfForQtLib/sources/pdfannotation.cpp b/PdfForQtLib/sources/pdfannotation.cpp index 66245e7..01a8464 100644 --- a/PdfForQtLib/sources/pdfannotation.cpp +++ b/PdfForQtLib/sources/pdfannotation.cpp @@ -384,24 +384,24 @@ PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObject PDFStampAnnotation* annotation = new PDFStampAnnotation(); result.reset(annotation); - constexpr const std::array, 14> stamps = { - std::pair{ "Approved", PDFStampAnnotation::Stamp::Approved }, - std::pair{ "AsIs", PDFStampAnnotation::Stamp::AsIs }, - std::pair{ "Confidential", PDFStampAnnotation::Stamp::Confidential }, - std::pair{ "Departmental", PDFStampAnnotation::Stamp::Departmental }, - std::pair{ "Draft", PDFStampAnnotation::Stamp::Draft }, - std::pair{ "Experimental", PDFStampAnnotation::Stamp::Experimental }, - std::pair{ "Expired", PDFStampAnnotation::Stamp::Expired }, - std::pair{ "Final", PDFStampAnnotation::Stamp::Final }, - std::pair{ "ForComment", PDFStampAnnotation::Stamp::ForComment }, - std::pair{ "ForPublicRelease", PDFStampAnnotation::Stamp::ForPublicRelease }, - std::pair{ "NotApproved", PDFStampAnnotation::Stamp::NotApproved }, - std::pair{ "NotForPublicRelease", PDFStampAnnotation::Stamp::NotForPublicRelease }, - std::pair{ "Sold", PDFStampAnnotation::Stamp::Sold }, - std::pair{ "TopSecret", PDFStampAnnotation::Stamp::TopSecret } + constexpr const std::array, 14> stamps = { + std::pair{ "Approved", Stamp::Approved }, + std::pair{ "AsIs", Stamp::AsIs }, + std::pair{ "Confidential", Stamp::Confidential }, + std::pair{ "Departmental", Stamp::Departmental }, + std::pair{ "Draft", Stamp::Draft }, + std::pair{ "Experimental", Stamp::Experimental }, + std::pair{ "Expired", Stamp::Expired }, + std::pair{ "Final", Stamp::Final }, + std::pair{ "ForComment", Stamp::ForComment }, + std::pair{ "ForPublicRelease", Stamp::ForPublicRelease }, + std::pair{ "NotApproved", Stamp::NotApproved }, + std::pair{ "NotForPublicRelease", Stamp::NotForPublicRelease }, + std::pair{ "Sold", Stamp::Sold }, + std::pair{ "TopSecret", Stamp::TopSecret } }; - annotation->m_stamp = loader.readEnumByName(dictionary->get("Name"), stamps.begin(), stamps.end(), PDFStampAnnotation::Stamp::Draft); + annotation->m_stamp = loader.readEnumByName(dictionary->get("Name"), stamps.begin(), stamps.end(), Stamp::Draft); } else if (subtype == "Ink") { @@ -2011,4 +2011,114 @@ void PDFInkAnnotation::draw(AnnotationDrawParameters& parameters) const parameters.boundingRectangle.adjust(-penWidth, -penWidth, penWidth, penWidth); } +void PDFStampAnnotation::draw(AnnotationDrawParameters& parameters) const +{ + QPainter& painter = *parameters.painter; + + QString text; + QColor color(Qt::red); + + switch (m_stamp) + { + case Stamp::Approved: + text = PDFTranslationContext::tr("APPROVED"); + color = Qt::green; + break; + + case Stamp::AsIs: + text = PDFTranslationContext::tr("AS IS"); + break; + + case Stamp::Confidential: + text = PDFTranslationContext::tr("CONFIDENTIAL"); + break; + + case Stamp::Departmental: + text = PDFTranslationContext::tr("DEPARTMENTAL"); + color = Qt::blue; + break; + + case Stamp::Draft: + text = PDFTranslationContext::tr("DRAFT"); + break; + + case Stamp::Experimental: + text = PDFTranslationContext::tr("EXPERIMENTAL"); + color = Qt::blue; + break; + + case Stamp::Expired: + text = PDFTranslationContext::tr("EXPIRED"); + break; + + case Stamp::Final: + text = PDFTranslationContext::tr("FINAL"); + break; + + case Stamp::ForComment: + text = PDFTranslationContext::tr("FOR COMMENT"); + color = Qt::green; + break; + + case Stamp::ForPublicRelease: + text = PDFTranslationContext::tr("FOR PUBLIC RELEASE"); + color = Qt::green; + break; + + case Stamp::NotApproved: + text = PDFTranslationContext::tr("NOT APPROVED"); + break; + + case Stamp::NotForPublicRelease: + text = PDFTranslationContext::tr("NOT FOR PUBLIC RELEASE"); + break; + + case Stamp::Sold: + text = PDFTranslationContext::tr("SOLD"); + color = Qt::blue; + break; + + case Stamp::TopSecret: + text = PDFTranslationContext::tr("TOP SECRET"); + break; + + default: + Q_ASSERT(false); + break; + } + + const PDFReal textHeight = 16; + QFont font("Courier New"); + font.setBold(true); + font.setPixelSize(textHeight); + + QFontMetricsF fontMetrics(font, painter.device()); + const qreal textWidth = fontMetrics.width(text); + const qreal rectangleWidth = textWidth + 10; + const qreal rectangleHeight = textHeight * 1.2; + const qreal penWidth = 2.0; + + QRectF rectangle = getRectangle(); + rectangle.setSize(QSizeF(rectangleWidth, rectangleHeight)); + + QPen pen(color); + pen.setWidthF(penWidth); + painter.setPen(pen); + painter.setBrush(Qt::NoBrush); + + painter.drawRoundedRect(rectangle, 5, 5, Qt::AbsoluteSize); + + // Draw text + QPainterPath textPath; + textPath.addText(0, 0, font, text); + textPath = QMatrix(1, 0, 0, -1, 0, 0).map(textPath); + + QPointF center = textPath.boundingRect().center(); + textPath.translate(rectangle.center() - center); + painter.fillPath(textPath, QBrush(color, Qt::SolidPattern)); + + parameters.boundingRectangle = rectangle; + parameters.boundingRectangle.adjust(-penWidth, -penWidth, penWidth, penWidth); +} + } // namespace pdf diff --git a/PdfForQtLib/sources/pdfannotation.h b/PdfForQtLib/sources/pdfannotation.h index 26a5e4b..55cfcca 100644 --- a/PdfForQtLib/sources/pdfannotation.h +++ b/PdfForQtLib/sources/pdfannotation.h @@ -930,6 +930,24 @@ private: Symbol m_symbol = Symbol::None; }; +enum class Stamp +{ + Approved, + AsIs, + Confidential, + Departmental, + Draft, + Experimental, + Expired, + Final, + ForComment, + ForPublicRelease, + NotApproved, + NotForPublicRelease, + Sold, + TopSecret +}; + /// Annotation for stamps. Displays text or graphics intended to look /// as if they were stamped on the paper. class PDFStampAnnotation : public PDFMarkupAnnotation @@ -937,25 +955,8 @@ class PDFStampAnnotation : public PDFMarkupAnnotation public: inline explicit PDFStampAnnotation() = default; - enum class Stamp - { - Approved, - AsIs, - Confidential, - Departmental, - Draft, - Experimental, - Expired, - Final, - ForComment, - ForPublicRelease, - NotApproved, - NotForPublicRelease, - Sold, - TopSecret - }; - virtual AnnotationType getType() const override { return AnnotationType::Stamp; } + virtual void draw(AnnotationDrawParameters& parameters) const override; Stamp getStamp() const { return m_stamp; } diff --git a/PdfForQtLib/sources/pdfdocumentbuilder.cpp b/PdfForQtLib/sources/pdfdocumentbuilder.cpp index cebbec6..8939019 100644 --- a/PdfForQtLib/sources/pdfdocumentbuilder.cpp +++ b/PdfForQtLib/sources/pdfdocumentbuilder.cpp @@ -219,6 +219,74 @@ void PDFObjectFactory::endDictionaryItem() std::get(dictionaryItem.object).addEntry(qMove(topItem.itemName), qMove(std::get(topItem.object))); } +PDFObjectFactory& PDFObjectFactory::operator<<(Stamp stamp) +{ + switch (stamp) + { + case Stamp::Approved: + *this << WrapName("Approved"); + break; + + case Stamp::AsIs: + *this << WrapName("AsIs"); + break; + + case Stamp::Confidential: + *this << WrapName("Confidential"); + break; + + case Stamp::Departmental: + *this << WrapName("Departmental"); + break; + + case Stamp::Draft: + *this << WrapName("Draft"); + break; + + case Stamp::Experimental: + *this << WrapName("Experimental"); + break; + + case Stamp::Expired: + *this << WrapName("Expired"); + break; + + case Stamp::Final: + *this << WrapName("Final"); + break; + + case Stamp::ForComment: + *this << WrapName("ForComment"); + break; + + case Stamp::ForPublicRelease: + *this << WrapName("ForPublicRelease"); + break; + + case Stamp::NotApproved: + *this << WrapName("NotApproved"); + break; + + case Stamp::NotForPublicRelease: + *this << WrapName("NotForPublicRelease"); + break; + + case Stamp::Sold: + *this << WrapName("Sold"); + break; + + case Stamp::TopSecret: + *this << WrapName("TopSecret"); + break; + + default: + Q_ASSERT(false); + break; + } + + return *this; +} + PDFObjectFactory& PDFObjectFactory::operator<<(const PDFObject& object) { addObject(object); @@ -2201,8 +2269,6 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationSquare(PDFObjectReference objectBuilder.endDictionaryItem(); objectBuilder.endDictionary(); PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); - PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(rectangle), false); - objectBuilder.beginDictionary(); objectBuilder.beginDictionaryItem("Annots"); objectBuilder.beginArray(); @@ -2330,6 +2396,62 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationSquiggly(PDFObjectReferen } +PDFObjectReference PDFDocumentBuilder::createAnnotationStamp(PDFObjectReference page, + QRectF rectangle, + Stamp stampType, + QString title, + QString subject, + QString contents) +{ + PDFObjectFactory objectBuilder; + + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Type"); + objectBuilder << WrapName("Annot"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subtype"); + objectBuilder << WrapName("Stamp"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Rect"); + objectBuilder << rectangle; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("P"); + objectBuilder << page; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Name"); + objectBuilder << stampType; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("M"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("CreationDate"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("T"); + objectBuilder << title; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Contents"); + objectBuilder << contents; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subj"); + objectBuilder << subject; + objectBuilder.endDictionaryItem(); + objectBuilder.endDictionary(); + PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Annots"); + objectBuilder.beginArray(); + objectBuilder << annotationObject; + objectBuilder.endArray(); + objectBuilder.endDictionaryItem(); + objectBuilder.endDictionary(); + PDFObject pageAnnots = objectBuilder.takeObject(); + appendTo(page, pageAnnots); + updateAnnotationAppearanceStreams(annotationObject); + return annotationObject; +} + + PDFObjectReference PDFDocumentBuilder::createAnnotationStrikeout(PDFObjectReference page, QRectF rectangle, QColor color, @@ -2516,55 +2638,6 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationText(PDFObjectReference p } -PDFObjectReference PDFDocumentBuilder::createAnnotationUnderline(PDFObjectReference page, - QRectF rectangle, - QColor color) -{ - PDFObjectFactory objectBuilder; - - objectBuilder.beginDictionary(); - objectBuilder.beginDictionaryItem("Type"); - objectBuilder << WrapName("Annot"); - objectBuilder.endDictionaryItem(); - objectBuilder.beginDictionaryItem("Subtype"); - objectBuilder << WrapName("Underline"); - objectBuilder.endDictionaryItem(); - objectBuilder.beginDictionaryItem("Rect"); - objectBuilder << rectangle; - objectBuilder.endDictionaryItem(); - objectBuilder.beginDictionaryItem("P"); - objectBuilder << page; - objectBuilder.endDictionaryItem(); - objectBuilder.beginDictionaryItem("CreationDate"); - objectBuilder << WrapCurrentDateTime(); - objectBuilder.endDictionaryItem(); - objectBuilder.beginDictionaryItem("C"); - objectBuilder << color; - objectBuilder.endDictionaryItem(); - objectBuilder.beginDictionaryItem("QuadPoints"); - objectBuilder.beginArray(); - objectBuilder << rectangle.bottomLeft(); - objectBuilder << rectangle.bottomRight(); - objectBuilder << rectangle.topLeft(); - objectBuilder << rectangle.topRight(); - objectBuilder.endArray(); - objectBuilder.endDictionaryItem(); - objectBuilder.endDictionary(); - PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); - objectBuilder.beginDictionary(); - objectBuilder.beginDictionaryItem("Annots"); - objectBuilder.beginArray(); - objectBuilder << annotationObject; - objectBuilder.endArray(); - objectBuilder.endDictionaryItem(); - objectBuilder.endDictionary(); - PDFObject pageAnnots = objectBuilder.takeObject(); - appendTo(page, pageAnnots); - updateAnnotationAppearanceStreams(annotationObject); - return annotationObject; -} - - PDFObjectReference PDFDocumentBuilder::createAnnotationUnderline(PDFObjectReference page, QRectF rectangle, QColor color, @@ -2629,6 +2702,55 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationUnderline(PDFObjectRefere } +PDFObjectReference PDFDocumentBuilder::createAnnotationUnderline(PDFObjectReference page, + QRectF rectangle, + QColor color) +{ + PDFObjectFactory objectBuilder; + + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Type"); + objectBuilder << WrapName("Annot"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subtype"); + objectBuilder << WrapName("Underline"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Rect"); + objectBuilder << rectangle; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("P"); + objectBuilder << page; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("CreationDate"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("C"); + objectBuilder << color; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("QuadPoints"); + objectBuilder.beginArray(); + objectBuilder << rectangle.bottomLeft(); + objectBuilder << rectangle.bottomRight(); + objectBuilder << rectangle.topLeft(); + objectBuilder << rectangle.topRight(); + objectBuilder.endArray(); + objectBuilder.endDictionaryItem(); + objectBuilder.endDictionary(); + PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Annots"); + objectBuilder.beginArray(); + objectBuilder << annotationObject; + objectBuilder.endArray(); + objectBuilder.endDictionaryItem(); + objectBuilder.endDictionary(); + PDFObject pageAnnots = objectBuilder.takeObject(); + appendTo(page, pageAnnots); + updateAnnotationAppearanceStreams(annotationObject); + return annotationObject; +} + + PDFObjectReference PDFDocumentBuilder::createCatalog() { PDFObjectFactory objectBuilder; diff --git a/PdfForQtLib/sources/pdfdocumentbuilder.h b/PdfForQtLib/sources/pdfdocumentbuilder.h index bd8fbe2..ff09335 100644 --- a/PdfForQtLib/sources/pdfdocumentbuilder.h +++ b/PdfForQtLib/sources/pdfdocumentbuilder.h @@ -111,6 +111,7 @@ public: PDFObjectFactory& operator<<(const QDateTime& dateTime); PDFObjectFactory& operator<<(AnnotationBorderStyle style); PDFObjectFactory& operator<<(const PDFObject& object); + PDFObjectFactory& operator<<(Stamp stamp); /// Treat containers - write them as array template()))> @@ -679,6 +680,21 @@ public: QColor color); + /// Stamp annotation + /// \param page Page to which is annotation added + /// \param rectangle Stamp area + /// \param stampType Stamp type + /// \param title Title + /// \param subject Subject + /// \param contents Contents + PDFObjectReference createAnnotationStamp(PDFObjectReference page, + QRectF rectangle, + Stamp stampType, + QString title, + QString subject, + QString contents); + + /// Text markup annotation is used to strikeout text. It is a markup annotation, so it can contain /// window to be opened (and commented). /// \param page Page to which is annotation added @@ -726,16 +742,6 @@ public: bool open); - /// Text markup annotation is used to underline text. It is a markup annotation, so it can contain - /// window to be opened (and commented). - /// \param page Page to which is annotation added - /// \param rectangle Area in which is markup displayed - /// \param color Color - PDFObjectReference createAnnotationUnderline(PDFObjectReference page, - QRectF rectangle, - QColor color); - - /// Text markup annotation is used to underline text. It is a markup annotation, so it can contain /// window to be opened (and commented). /// \param page Page to which is annotation added @@ -752,6 +758,16 @@ public: QString contents); + /// Text markup annotation is used to underline text. It is a markup annotation, so it can contain + /// window to be opened (and commented). + /// \param page Page to which is annotation added + /// \param rectangle Area in which is markup displayed + /// \param color Color + PDFObjectReference createAnnotationUnderline(PDFObjectReference page, + QRectF rectangle, + QColor color); + + /// Creates empty catalog. This function is used, when a new document is being created. Do not call /// this function manually. PDFObjectReference createCatalog(); diff --git a/generated_code_definition.xml b/generated_code_definition.xml index d47b73b..53e1c85 100644 --- a/generated_code_definition.xml +++ b/generated_code_definition.xml @@ -3819,14 +3819,6 @@ return popupAnnotation; _PDFObjectReference - - - - Code - - _void - PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(rectangle), false); - @@ -4234,6 +4226,195 @@ return annotationObject; Text markup annotation is used to squiggly underline text. It is a markup annotation, so it can contain window to be opened (and commented). _PDFObjectReference + + + + + + + + + + page + _PDFObjectReference + Page to which is annotation added + + + + + rectangle + _QRectF + Stamp area + + + + + stampType + _Stamp + Stamp type + + + + + title + _QString + Title + + + + + subject + _QString + Subject + + + + + contents + _QString + Contents + + + Parameters + + _void + + + + + + + + + + + + Type + DictionaryItemSimple + WrapName("Annot") + + + + + Subtype + DictionaryItemSimple + WrapName("Stamp") + + + + + Rect + DictionaryItemSimple + rectangle + + + + + P + DictionaryItemSimple + page + + + + + Name + DictionaryItemSimple + stampType + + + + + M + DictionaryItemSimple + WrapCurrentDateTime() + + + + + CreationDate + DictionaryItemSimple + WrapCurrentDateTime() + + + + + T + DictionaryItemSimple + title + + + + + Contents + DictionaryItemSimple + contents + + + + + Subj + DictionaryItemSimple + subject + + + + Dictionary + + + + CreateObject + annotationObject + _PDFObjectReference + + + + + + + + + + + + + + + + ArraySimple + annotationObject + + + Annots + DictionaryItemComplex + + + + + Dictionary + + + + CreateObject + pageAnnots + _PDFObject + + + + + + Code + + _void + appendTo(page, pageAnnots); +updateAnnotationAppearanceStreams(annotationObject); +return annotationObject; + + + Annotations + createAnnotationStamp + Stamp annotation + _PDFObjectReference + @@ -4836,161 +5017,6 @@ return annotationObject; Creates text annotation. Text annotation is "sticky note" attached to a point in the PDF document. When closed, it is displayed as icon, if opened, widget appears with attached text. Text annotations do not scale or rotate, they appear independent of zoom/rotate. So, they behave as if flags NoZoom or NoRotate to the annotations are being set. Popup annotation is automatically created for this annotation. _PDFObjectReference - - - - - - - - - - page - _PDFObjectReference - Page to which is annotation added - - - - - rectangle - _QRectF - Area in which is markup displayed - - - - - color - _QColor - Color - - - Parameters - - _void - - - - - - - - - - - - Type - DictionaryItemSimple - WrapName("Annot") - - - - - Subtype - DictionaryItemSimple - WrapName("Underline") - - - - - Rect - DictionaryItemSimple - rectangle - - - - - P - DictionaryItemSimple - page - - - - - CreationDate - DictionaryItemSimple - WrapCurrentDateTime() - - - - - C - DictionaryItemSimple - color - - - - - - - - - ArraySimple - rectangle.bottomLeft();rectangle.bottomRight();rectangle.topLeft();rectangle.topRight() - - - QuadPoints - DictionaryItemComplex - - - - - Dictionary - - - - CreateObject - annotationObject - _PDFObjectReference - - - - - - - - - - - - - - - - ArraySimple - annotationObject - - - Annots - DictionaryItemComplex - - - - - Dictionary - - - - CreateObject - pageAnnots - _PDFObject - - - - - - Code - - _void - appendTo(page, pageAnnots); -updateAnnotationAppearanceStreams(annotationObject); -return annotationObject; - - - Annotations - createAnnotationUnderline - Text markup annotation is used to underline text. It is a markup annotation, so it can contain window to be opened (and commented). - _PDFObjectReference - @@ -5187,6 +5213,161 @@ return annotationObject; _void appendTo(page, pageAnnots); updateAnnotationAppearanceStreams(annotationObject); +return annotationObject; + + + Annotations + createAnnotationUnderline + Text markup annotation is used to underline text. It is a markup annotation, so it can contain window to be opened (and commented). + _PDFObjectReference + + + + + + + + + + + page + _PDFObjectReference + Page to which is annotation added + + + + + rectangle + _QRectF + Area in which is markup displayed + + + + + color + _QColor + Color + + + Parameters + + _void + + + + + + + + + + + + Type + DictionaryItemSimple + WrapName("Annot") + + + + + Subtype + DictionaryItemSimple + WrapName("Underline") + + + + + Rect + DictionaryItemSimple + rectangle + + + + + P + DictionaryItemSimple + page + + + + + CreationDate + DictionaryItemSimple + WrapCurrentDateTime() + + + + + C + DictionaryItemSimple + color + + + + + + + + + ArraySimple + rectangle.bottomLeft();rectangle.bottomRight();rectangle.topLeft();rectangle.topRight() + + + QuadPoints + DictionaryItemComplex + + + + + Dictionary + + + + CreateObject + annotationObject + _PDFObjectReference + + + + + + + + + + + + + + + + ArraySimple + annotationObject + + + Annots + DictionaryItemComplex + + + + + Dictionary + + + + CreateObject + pageAnnots + _PDFObject + + + + + + Code + + _void + appendTo(page, pageAnnots); +updateAnnotationAppearanceStreams(annotationObject); return annotationObject;