From 77972bbad306e3c3f4d8094dadc54d8800924666 Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Fri, 27 Mar 2020 19:29:21 +0100 Subject: [PATCH] Highlight annotations --- CodeGenerator/generatormainwindow.ui | 2 +- PdfExampleGenerator/pdfexamplesgenerator.cpp | 20 + PdfForQtLib/sources/pdfdocumentbuilder.cpp | 501 +++++- PdfForQtLib/sources/pdfdocumentbuilder.h | 124 +- generated_code_definition.xml | 1647 ++++++++++++++++-- 5 files changed, 2059 insertions(+), 235 deletions(-) diff --git a/CodeGenerator/generatormainwindow.ui b/CodeGenerator/generatormainwindow.ui index a0eb644..35d5ebd 100644 --- a/CodeGenerator/generatormainwindow.ui +++ b/CodeGenerator/generatormainwindow.ui @@ -102,7 +102,7 @@ false - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextSelectableByMouse + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse diff --git a/PdfExampleGenerator/pdfexamplesgenerator.cpp b/PdfExampleGenerator/pdfexamplesgenerator.cpp index 25e4666..df91b5e 100644 --- a/PdfExampleGenerator/pdfexamplesgenerator.cpp +++ b/PdfExampleGenerator/pdfexamplesgenerator.cpp @@ -160,6 +160,26 @@ void PDFExamplesGenerator::generateAnnotationsExample() polygon.translate(0, -100); builder.createAnnotationPolyline(page7, polygon, 2.0, Qt::green, Qt::yellow, "Title", "Subject", "Contents", pdf::AnnotationLineEnding::ClosedArrow, pdf::AnnotationLineEnding::Circle); + pdf::PDFObjectReference page8 = builder.appendPage(QRectF(0, 0, 400, 400)); + builder.createAnnotationHighlight(page8, QRectF(50, 50, 50, 50), Qt::yellow, "Title1", "Subject1", "Contents - green filling, red boundary"); + builder.createAnnotationHighlight(page8, QRectF(50, 150, 50, 50), Qt::green); + builder.createAnnotationHighlight(page8, QRectF(50, 250, 50, 50), Qt::red); + + pdf::PDFObjectReference page9 = builder.appendPage(QRectF(0, 0, 400, 400)); + builder.createAnnotationUnderline(page9, QRectF(50, 50, 50, 50), Qt::yellow, "Title1", "Subject1", "Contents - green filling, red boundary"); + builder.createAnnotationUnderline(page9, QRectF(50, 150, 50, 50), Qt::green); + builder.createAnnotationUnderline(page9, QRectF(50, 250, 50, 50), Qt::red); + + pdf::PDFObjectReference page10 = builder.appendPage(QRectF(0, 0, 400, 400)); + builder.createAnnotationSquiggly(page10, QRectF(50, 50, 50, 50), Qt::yellow, "Title1", "Subject1", "Contents - green filling, red boundary"); + builder.createAnnotationSquiggly(page10, QRectF(50, 150, 50, 50), Qt::green); + builder.createAnnotationSquiggly(page10, QRectF(50, 250, 50, 50), Qt::red); + + pdf::PDFObjectReference page11 = builder.appendPage(QRectF(0, 0, 400, 400)); + builder.createAnnotationStrikeout(page11, QRectF(50, 50, 50, 50), Qt::yellow, "Title1", "Subject1", "Contents - green filling, red boundary"); + builder.createAnnotationStrikeout(page11, QRectF(50, 150, 50, 50), Qt::green); + builder.createAnnotationStrikeout(page11, QRectF(50, 250, 50, 50), Qt::red); + // Write result to a file pdf::PDFDocument document = builder.build(); pdf::PDFDocumentWriter writer(nullptr); diff --git a/PdfForQtLib/sources/pdfdocumentbuilder.cpp b/PdfForQtLib/sources/pdfdocumentbuilder.cpp index 8544ba3..1481ba5 100644 --- a/PdfForQtLib/sources/pdfdocumentbuilder.cpp +++ b/PdfForQtLib/sources/pdfdocumentbuilder.cpp @@ -604,24 +604,14 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationCircle(PDFObjectReference objectBuilder.endDictionaryItem(); objectBuilder.endDictionary(); PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); - PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(rectangle), false); - - objectBuilder.beginDictionary(); - objectBuilder.beginDictionaryItem("Popup"); - objectBuilder << popupAnnotation; - objectBuilder.endDictionaryItem(); - objectBuilder.endDictionary(); - PDFObject updateAnnotationPopup = objectBuilder.takeObject(); objectBuilder.beginDictionary(); objectBuilder.beginDictionaryItem("Annots"); objectBuilder.beginArray(); objectBuilder << annotationObject; - objectBuilder << popupAnnotation; objectBuilder.endArray(); objectBuilder.endDictionaryItem(); objectBuilder.endDictionary(); PDFObject pageAnnots = objectBuilder.takeObject(); - mergeTo(annotationObject, updateAnnotationPopup); appendTo(page, pageAnnots); return annotationObject; } @@ -771,6 +761,117 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationFreeText(PDFObjectReferen } +PDFObjectReference PDFDocumentBuilder::createAnnotationHighlight(PDFObjectReference page, + QRectF rectangle, + QColor color, + QString title, + QString subject, + QString contents) +{ + PDFObjectFactory objectBuilder; + + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Type"); + objectBuilder << WrapName("Annot"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subtype"); + objectBuilder << WrapName("Highlight"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Rect"); + objectBuilder << rectangle; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("P"); + objectBuilder << page; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("M"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("CreationDate"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("C"); + objectBuilder << color; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("T"); + objectBuilder << title; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Contents"); + objectBuilder << contents; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subj"); + objectBuilder << subject; + 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); + return annotationObject; +} + + +PDFObjectReference PDFDocumentBuilder::createAnnotationHighlight(PDFObjectReference page, + QRectF rectangle, + QColor color) +{ + PDFObjectFactory objectBuilder; + + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Type"); + objectBuilder << WrapName("Annot"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subtype"); + objectBuilder << WrapName("Highlight"); + 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); + return annotationObject; +} + + PDFObjectReference PDFDocumentBuilder::createAnnotationLine(PDFObjectReference page, QRectF boundingRect, QPointF startPoint, @@ -844,22 +945,14 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationLine(PDFObjectReference p PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(boundingRect), false); - objectBuilder.beginDictionary(); - objectBuilder.beginDictionaryItem("Popup"); - objectBuilder << popupAnnotation; - objectBuilder.endDictionaryItem(); - objectBuilder.endDictionary(); - PDFObject updateAnnotationPopup = objectBuilder.takeObject(); objectBuilder.beginDictionary(); objectBuilder.beginDictionaryItem("Annots"); objectBuilder.beginArray(); objectBuilder << annotationObject; - objectBuilder << popupAnnotation; objectBuilder.endArray(); objectBuilder.endDictionaryItem(); objectBuilder.endDictionary(); PDFObject pageAnnots = objectBuilder.takeObject(); - mergeTo(annotationObject, updateAnnotationPopup); appendTo(page, pageAnnots); return annotationObject; } @@ -958,22 +1051,14 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationLine(PDFObjectReference p PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(boundingRect), false); - objectBuilder.beginDictionary(); - objectBuilder.beginDictionaryItem("Popup"); - objectBuilder << popupAnnotation; - objectBuilder.endDictionaryItem(); - objectBuilder.endDictionary(); - PDFObject updateAnnotationPopup = objectBuilder.takeObject(); objectBuilder.beginDictionary(); objectBuilder.beginDictionaryItem("Annots"); objectBuilder.beginArray(); objectBuilder << annotationObject; - objectBuilder << popupAnnotation; objectBuilder.endArray(); objectBuilder.endDictionaryItem(); objectBuilder.endDictionary(); PDFObject pageAnnots = objectBuilder.takeObject(); - mergeTo(annotationObject, updateAnnotationPopup); appendTo(page, pageAnnots); return annotationObject; } @@ -1089,22 +1174,14 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationPolygon(PDFObjectReferenc PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(polygon.boundingRect()), false); - objectBuilder.beginDictionary(); - objectBuilder.beginDictionaryItem("Popup"); - objectBuilder << popupAnnotation; - objectBuilder.endDictionaryItem(); - objectBuilder.endDictionary(); - PDFObject updateAnnotationPopup = objectBuilder.takeObject(); objectBuilder.beginDictionary(); objectBuilder.beginDictionaryItem("Annots"); objectBuilder.beginArray(); objectBuilder << annotationObject; - objectBuilder << popupAnnotation; objectBuilder.endArray(); objectBuilder.endDictionaryItem(); objectBuilder.endDictionary(); PDFObject pageAnnots = objectBuilder.takeObject(); - mergeTo(annotationObject, updateAnnotationPopup); appendTo(page, pageAnnots); return annotationObject; } @@ -1176,22 +1253,14 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationPolyline(PDFObjectReferen PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(polyline.boundingRect()), false); - objectBuilder.beginDictionary(); - objectBuilder.beginDictionaryItem("Popup"); - objectBuilder << popupAnnotation; - objectBuilder.endDictionaryItem(); - objectBuilder.endDictionary(); - PDFObject updateAnnotationPopup = objectBuilder.takeObject(); objectBuilder.beginDictionary(); objectBuilder.beginDictionaryItem("Annots"); objectBuilder.beginArray(); objectBuilder << annotationObject; - objectBuilder << popupAnnotation; objectBuilder.endArray(); objectBuilder.endDictionaryItem(); objectBuilder.endDictionary(); PDFObject pageAnnots = objectBuilder.takeObject(); - mergeTo(annotationObject, updateAnnotationPopup); appendTo(page, pageAnnots); return annotationObject; } @@ -1225,6 +1294,13 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationPopup(PDFObjectReference objectBuilder.endDictionaryItem(); objectBuilder.endDictionary(); PDFObjectReference popupAnnotation = addObject(objectBuilder.takeObject()); + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Popup"); + objectBuilder << popupAnnotation; + objectBuilder.endDictionaryItem(); + objectBuilder.endDictionary(); + PDFObject upgradedParentAnnotation = objectBuilder.takeObject(); + mergeTo(parentAnnotation, upgradedParentAnnotation); return popupAnnotation; } @@ -1284,22 +1360,236 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationSquare(PDFObjectReference PDFObjectReference annotationObject = addObject(objectBuilder.takeObject()); PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(rectangle), false); - objectBuilder.beginDictionary(); - objectBuilder.beginDictionaryItem("Popup"); - objectBuilder << popupAnnotation; - objectBuilder.endDictionaryItem(); - objectBuilder.endDictionary(); - PDFObject updateAnnotationPopup = objectBuilder.takeObject(); objectBuilder.beginDictionary(); objectBuilder.beginDictionaryItem("Annots"); objectBuilder.beginArray(); objectBuilder << annotationObject; - objectBuilder << popupAnnotation; objectBuilder.endArray(); objectBuilder.endDictionaryItem(); objectBuilder.endDictionary(); PDFObject pageAnnots = objectBuilder.takeObject(); - mergeTo(annotationObject, updateAnnotationPopup); + appendTo(page, pageAnnots); + return annotationObject; +} + + +PDFObjectReference PDFDocumentBuilder::createAnnotationSquiggly(PDFObjectReference page, + QRectF rectangle, + QColor color, + QString title, + QString subject, + QString contents) +{ + PDFObjectFactory objectBuilder; + + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Type"); + objectBuilder << WrapName("Annot"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subtype"); + objectBuilder << WrapName("Squiggly"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Rect"); + objectBuilder << rectangle; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("P"); + objectBuilder << page; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("M"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("CreationDate"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("C"); + objectBuilder << color; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("T"); + objectBuilder << title; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Contents"); + objectBuilder << contents; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subj"); + objectBuilder << subject; + 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); + return annotationObject; +} + + +PDFObjectReference PDFDocumentBuilder::createAnnotationSquiggly(PDFObjectReference page, + QRectF rectangle, + QColor color) +{ + PDFObjectFactory objectBuilder; + + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Type"); + objectBuilder << WrapName("Annot"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subtype"); + objectBuilder << WrapName("Squiggly"); + 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); + return annotationObject; +} + + +PDFObjectReference PDFDocumentBuilder::createAnnotationStrikeout(PDFObjectReference page, + QRectF rectangle, + QColor color, + QString title, + QString subject, + QString contents) +{ + PDFObjectFactory objectBuilder; + + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Type"); + objectBuilder << WrapName("Annot"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subtype"); + objectBuilder << WrapName("StrikeOut"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Rect"); + objectBuilder << rectangle; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("P"); + objectBuilder << page; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("M"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("CreationDate"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("C"); + objectBuilder << color; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("T"); + objectBuilder << title; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Contents"); + objectBuilder << contents; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subj"); + objectBuilder << subject; + 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); + return annotationObject; +} + + +PDFObjectReference PDFDocumentBuilder::createAnnotationStrikeout(PDFObjectReference page, + QRectF rectangle, + QColor color) +{ + PDFObjectFactory objectBuilder; + + objectBuilder.beginDictionary(); + objectBuilder.beginDictionaryItem("Type"); + objectBuilder << WrapName("Annot"); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subtype"); + objectBuilder << WrapName("StrikeOut"); + 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); return annotationObject; } @@ -1377,6 +1667,117 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationText(PDFObjectReference p } +PDFObjectReference PDFDocumentBuilder::createAnnotationUnderline(PDFObjectReference page, + QRectF rectangle, + QColor color, + QString title, + QString subject, + QString contents) +{ + 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("M"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("CreationDate"); + objectBuilder << WrapCurrentDateTime(); + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("C"); + objectBuilder << color; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("T"); + objectBuilder << title; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Contents"); + objectBuilder << contents; + objectBuilder.endDictionaryItem(); + objectBuilder.beginDictionaryItem("Subj"); + objectBuilder << subject; + 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); + return annotationObject; +} + + +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); + return annotationObject; +} + + PDFObjectReference PDFDocumentBuilder::createCatalog() { PDFObjectFactory objectBuilder; diff --git a/PdfForQtLib/sources/pdfdocumentbuilder.h b/PdfForQtLib/sources/pdfdocumentbuilder.h index 792e0be..f647d48 100644 --- a/PdfForQtLib/sources/pdfdocumentbuilder.h +++ b/PdfForQtLib/sources/pdfdocumentbuilder.h @@ -222,9 +222,8 @@ public: PDFObjectReference createActionURI(QString URL); - /// Circle annotation displays ellipse (or circle). When opened, they display pop-up window containing - /// the text of associated note (and window title). Circle border/fill color can be defined, along with - /// border width. + /// Circle annotation displays ellipse (or circle). Circle border/fill color can be defined, along with + /// border width. Popup annotation can be attached to this annotation. /// \param page Page to which is annotation added /// \param rectangle Area in which is circle/ellipse displayed /// \param borderWidth Width of the border line of circle/ellipse @@ -292,6 +291,34 @@ public: AnnotationLineEnding endLineType); + /// Text markup annotation is used to highlight text. It is a markup annotation, so it can contain + /// window to be opened (and commented). This annotation is usually used to highlight text, but can + /// also highlight other things, such as images, or other graphics. + /// \param page Page to which is annotation added + /// \param rectangle Area in which is highlight displayed + /// \param color Color + /// \param title Title + /// \param subject Subject + /// \param contents Contents + PDFObjectReference createAnnotationHighlight(PDFObjectReference page, + QRectF rectangle, + QColor color, + QString title, + QString subject, + QString contents); + + + /// Text markup annotation is used to highlight text. It is a markup annotation, so it can contain + /// window to be opened (and commented). This annotation is usually used to highlight text, but can + /// also highlight other things, such as images, or other graphics. + /// \param page Page to which is annotation added + /// \param rectangle Area in which is highlight displayed + /// \param color Color + PDFObjectReference createAnnotationHighlight(PDFObjectReference page, + QRectF rectangle, + QColor color); + + /// Line annotation represents straight line, or some more advanced graphics, such as dimension with /// text. Line annotations are markup annotations, so they can have popup window. Line endings can /// be specified. @@ -392,7 +419,8 @@ public: /// Polygon annotation. When opened, they display pop-up window containing the text of associated - /// note (and window title). Polygon border/fill color can be defined, along with border width. + /// note (and window title), if popup annotation is attached. Polygon border/fill color can be defined, + /// along with border width. /// \param page Page to which is annotation added /// \param polygon Polygon /// \param borderWidth Border line width @@ -412,7 +440,8 @@ public: /// Polyline annotation. When opened, they display pop-up window containing the text of associated - /// note (and window title). Polyline border/fill color can be defined, along with border width. + /// note (and window title), if popup annotation is attached. Polyline border/fill color can be defined, + /// along with border width. /// \param page Page to which is annotation added /// \param polyline Polyline /// \param borderWidth Border line width @@ -450,8 +479,8 @@ public: /// Square annotation displays rectangle (or square). When opened, they display pop-up window - /// containing the text of associated note (and window title). Square border/fill color can be defined, - /// along with border width. + /// containing the text of associated note (and window title), if popup annotation is attached. Square + /// border/fill color can be defined, along with border width. /// \param page Page to which is annotation added /// \param rectangle Area in which is rectangle displayed /// \param borderWidth Width of the border line of rectangle @@ -472,10 +501,63 @@ public: QString contents); + /// Text markup annotation is used to squiggly 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 + /// \param title Title + /// \param subject Subject + /// \param contents Contents + PDFObjectReference createAnnotationSquiggly(PDFObjectReference page, + QRectF rectangle, + QColor color, + QString title, + QString subject, + QString contents); + + + /// Text markup annotation is used to squiggly 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 createAnnotationSquiggly(PDFObjectReference page, + QRectF rectangle, + QColor color); + + + /// 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 + /// \param rectangle Area in which is markup displayed + /// \param color Color + /// \param title Title + /// \param subject Subject + /// \param contents Contents + PDFObjectReference createAnnotationStrikeout(PDFObjectReference page, + QRectF rectangle, + QColor color, + 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 + /// \param rectangle Area in which is markup displayed + /// \param color Color + PDFObjectReference createAnnotationStrikeout(PDFObjectReference page, + QRectF rectangle, + QColor color); + + /// 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. + /// NoZoom or NoRotate to the annotations are being set. Popup annotation is automatically created + /// for this annotation. /// \param page Page to which is annotation added /// \param rectangle Area in which is icon displayed /// \param iconType Icon type @@ -492,6 +574,32 @@ 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 + /// \param title Title + /// \param subject Subject + /// \param contents Contents + PDFObjectReference createAnnotationUnderline(PDFObjectReference page, + QRectF rectangle, + QColor color, + QString title, + QString subject, + 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 358ed70..a83c741 100644 --- a/generated_code_definition.xml +++ b/generated_code_definition.xml @@ -359,38 +359,6 @@ return pageReference; _PDFObjectReference - - - - Code - - _void - PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(rectangle), false); - - - - - - - - - - - Popup - DictionaryItemSimple - popupAnnotation - - - Popup - Dictionary - popupAnnotation - - - CreateObject - updateAnnotationPopup - _PDFObject - - @@ -405,7 +373,7 @@ return pageReference; ArraySimple - annotationObject;popupAnnotation + annotationObject Annots @@ -429,14 +397,13 @@ return pageReference; Code _void - mergeTo(annotationObject, updateAnnotationPopup); -appendTo(page, pageAnnots); + appendTo(page, pageAnnots); return annotationObject; Annotations createAnnotationCircle - Circle annotation displays ellipse (or circle). When opened, they display pop-up window containing the text of associated note (and window title). Circle border/fill color can be defined, along with border width. + Circle annotation displays ellipse (or circle). Circle border/fill color can be defined, along with border width. Popup annotation can be attached to this annotation. _PDFObjectReference @@ -915,6 +882,363 @@ return annotationObject; Free text annotation displays text directly on a page. Text appears directly on the page, in the same way, as standard text in PDF document. Free text annotations are usually used to comment the document. Free text annotation can also have callout line, with, or without a knee. Specify start/end point parameters of this function to get callout line. _PDFObjectReference + + + + + + + + + + page + _PDFObjectReference + Page to which is annotation added + + + + + rectangle + _QRectF + Area in which is highlight displayed + + + + + color + _QColor + Color + + + + + title + _QString + Title + + + + + subject + _QString + Subject + + + + + contents + _QString + Contents + + + Parameters + + _void + + + + + + + + + + + + Type + DictionaryItemSimple + WrapName("Annot") + + + + + Subtype + DictionaryItemSimple + WrapName("Highlight") + + + + + Rect + DictionaryItemSimple + rectangle + + + + + P + DictionaryItemSimple + page + + + + + M + DictionaryItemSimple + WrapCurrentDateTime() + + + + + CreationDate + DictionaryItemSimple + WrapCurrentDateTime() + + + + + C + DictionaryItemSimple + color + + + + + T + DictionaryItemSimple + title + + + + + Contents + DictionaryItemSimple + contents + + + + + Subj + DictionaryItemSimple + subject + + + + + + + + + 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); +return annotationObject; + + + Annotations + createAnnotationHighlight + Text markup annotation is used to highlight text. It is a markup annotation, so it can contain window to be opened (and commented). This annotation is usually used to highlight text, but can also highlight other things, such as images, or other graphics. + _PDFObjectReference + + + + + + + + + + + page + _PDFObjectReference + Page to which is annotation added + + + + + rectangle + _QRectF + Area in which is highlight displayed + + + + + color + _QColor + Color + + + Parameters + + _void + + + + + + + + + + + + Type + DictionaryItemSimple + WrapName("Annot") + + + + + Subtype + DictionaryItemSimple + WrapName("Highlight") + + + + + 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); +return annotationObject; + + + Annotations + createAnnotationHighlight + Text markup annotation is used to highlight text. It is a markup annotation, so it can contain window to be opened (and commented). This annotation is usually used to highlight text, but can also highlight other things, such as images, or other graphics. + _PDFObjectReference + @@ -1157,30 +1481,6 @@ return annotationObject; _void PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(boundingRect), false); - - - - - - - - - - Popup - DictionaryItemSimple - popupAnnotation - - - Popup - Dictionary - popupAnnotation - - - CreateObject - updateAnnotationPopup - _PDFObject - - @@ -1195,7 +1495,7 @@ return annotationObject; ArraySimple - annotationObject;popupAnnotation + annotationObject Annots @@ -1219,8 +1519,7 @@ return annotationObject; Code _void - mergeTo(annotationObject, updateAnnotationPopup); -appendTo(page, pageAnnots); + appendTo(page, pageAnnots); return annotationObject; @@ -1541,30 +1840,6 @@ return annotationObject; _void PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(boundingRect), false); - - - - - - - - - - Popup - DictionaryItemSimple - popupAnnotation - - - Popup - Dictionary - popupAnnotation - - - CreateObject - updateAnnotationPopup - _PDFObject - - @@ -1579,7 +1854,7 @@ return annotationObject; ArraySimple - annotationObject;popupAnnotation + annotationObject Annots @@ -1603,8 +1878,7 @@ return annotationObject; Code _void - mergeTo(annotationObject, updateAnnotationPopup); -appendTo(page, pageAnnots); + appendTo(page, pageAnnots); return annotationObject; @@ -2004,30 +2278,6 @@ return annotationReference; _void PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(polygon.boundingRect()), false); - - - - - - - - - - Popup - DictionaryItemSimple - popupAnnotation - - - Popup - Dictionary - popupAnnotation - - - CreateObject - updateAnnotationPopup - _PDFObject - - @@ -2042,7 +2292,7 @@ return annotationReference; ArraySimple - annotationObject;popupAnnotation + annotationObject Annots @@ -2066,14 +2316,13 @@ return annotationReference; Code _void - mergeTo(annotationObject, updateAnnotationPopup); -appendTo(page, pageAnnots); + appendTo(page, pageAnnots); return annotationObject; Annotations createAnnotationPolygon - Polygon annotation. When opened, they display pop-up window containing the text of associated note (and window title). Polygon border/fill color can be defined, along with border width. + Polygon annotation. When opened, they display pop-up window containing the text of associated note (and window title), if popup annotation is attached. Polygon border/fill color can be defined, along with border width. _PDFObjectReference @@ -2296,30 +2545,6 @@ return annotationObject; _void PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(polyline.boundingRect()), false); - - - - - - - - - - Popup - DictionaryItemSimple - popupAnnotation - - - Popup - Dictionary - popupAnnotation - - - CreateObject - updateAnnotationPopup - _PDFObject - - @@ -2334,7 +2559,7 @@ return annotationObject; ArraySimple - annotationObject;popupAnnotation + annotationObject Annots @@ -2358,14 +2583,13 @@ return annotationObject; Code _void - mergeTo(annotationObject, updateAnnotationPopup); -appendTo(page, pageAnnots); + appendTo(page, pageAnnots); return annotationObject; Annotations createAnnotationPolyline - Polyline annotation. When opened, they display pop-up window containing the text of associated note (and window title). Polyline border/fill color can be defined, along with border width. + Polyline annotation. When opened, they display pop-up window containing the text of associated note (and window title), if popup annotation is attached. Polyline border/fill color can be defined, along with border width. _PDFObjectReference @@ -2467,13 +2691,38 @@ return annotationObject; _PDFObjectReference + + + + + + + + + + Popup + DictionaryItemSimple + popupAnnotation + + + + Dictionary + + + + CreateObject + upgradedParentAnnotation + _PDFObject + + Code _void - return popupAnnotation; + mergeTo(parentAnnotation, upgradedParentAnnotation); +return popupAnnotation; Annotations @@ -2665,30 +2914,6 @@ return annotationObject; _void PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(rectangle), false); - - - - - - - - - - Popup - DictionaryItemSimple - popupAnnotation - - - Popup - Dictionary - popupAnnotation - - - CreateObject - updateAnnotationPopup - _PDFObject - - @@ -2703,7 +2928,7 @@ return annotationObject; ArraySimple - annotationObject;popupAnnotation + annotationObject Annots @@ -2727,14 +2952,727 @@ return annotationObject; Code _void - mergeTo(annotationObject, updateAnnotationPopup); -appendTo(page, pageAnnots); + appendTo(page, pageAnnots); return annotationObject; Annotations createAnnotationSquare - Square annotation displays rectangle (or square). When opened, they display pop-up window containing the text of associated note (and window title). Square border/fill color can be defined, along with border width. + Square annotation displays rectangle (or square). When opened, they display pop-up window containing the text of associated note (and window title), if popup annotation is attached. Square border/fill color can be defined, along with border width. + _PDFObjectReference + + + + + + + + + + + page + _PDFObjectReference + Page to which is annotation added + + + + + rectangle + _QRectF + Area in which is markup displayed + + + + + color + _QColor + Color + + + + + title + _QString + Title + + + + + subject + _QString + Subject + + + + + contents + _QString + Contents + + + Parameters + + _void + + + + + + + + + + + + Type + DictionaryItemSimple + WrapName("Annot") + + + + + Subtype + DictionaryItemSimple + WrapName("Squiggly") + + + + + Rect + DictionaryItemSimple + rectangle + + + + + P + DictionaryItemSimple + page + + + + + M + DictionaryItemSimple + WrapCurrentDateTime() + + + + + CreationDate + DictionaryItemSimple + WrapCurrentDateTime() + + + + + C + DictionaryItemSimple + color + + + + + T + DictionaryItemSimple + title + + + + + Contents + DictionaryItemSimple + contents + + + + + Subj + DictionaryItemSimple + subject + + + + + + + + + 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); +return annotationObject; + + + Annotations + createAnnotationSquiggly + 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 + Area in which is markup displayed + + + + + color + _QColor + Color + + + Parameters + + _void + + + + + + + + + + + + Type + DictionaryItemSimple + WrapName("Annot") + + + + + Subtype + DictionaryItemSimple + WrapName("Squiggly") + + + + + 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); +return annotationObject; + + + Annotations + createAnnotationSquiggly + 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 + Area in which is markup displayed + + + + + color + _QColor + Color + + + + + title + _QString + Title + + + + + subject + _QString + Subject + + + + + contents + _QString + Contents + + + Parameters + + _void + + + + + + + + + + + + Type + DictionaryItemSimple + WrapName("Annot") + + + + + Subtype + DictionaryItemSimple + WrapName("StrikeOut") + + + + + Rect + DictionaryItemSimple + rectangle + + + + + P + DictionaryItemSimple + page + + + + + M + DictionaryItemSimple + WrapCurrentDateTime() + + + + + CreationDate + DictionaryItemSimple + WrapCurrentDateTime() + + + + + C + DictionaryItemSimple + color + + + + + T + DictionaryItemSimple + title + + + + + Contents + DictionaryItemSimple + contents + + + + + Subj + DictionaryItemSimple + subject + + + + + + + + + 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); +return annotationObject; + + + Annotations + createAnnotationStrikeout + Text markup annotation is used to strikeout 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("StrikeOut") + + + + + 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); +return annotationObject; + + + Annotations + createAnnotationStrikeout + Text markup annotation is used to strikeout text. It is a markup annotation, so it can contain window to be opened (and commented). _PDFObjectReference @@ -2976,7 +3914,364 @@ return annotationObject; Annotations createAnnotationText - 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. + 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 + + + + + title + _QString + Title + + + + + subject + _QString + Subject + + + + + contents + _QString + Contents + + + Parameters + + _void + + + + + + + + + + + + Type + DictionaryItemSimple + WrapName("Annot") + + + + + Subtype + DictionaryItemSimple + WrapName("Underline") + + + + + Rect + DictionaryItemSimple + rectangle + + + + + P + DictionaryItemSimple + page + + + + + M + DictionaryItemSimple + WrapCurrentDateTime() + + + + + CreationDate + DictionaryItemSimple + WrapCurrentDateTime() + + + + + C + DictionaryItemSimple + color + + + + + T + DictionaryItemSimple + title + + + + + Contents + DictionaryItemSimple + contents + + + + + Subj + DictionaryItemSimple + subject + + + + + + + + + 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); +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); +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