mirror of https://github.com/JakubMelka/PDF4QT.git
Text annotation
This commit is contained in:
parent
fcaa288c5b
commit
35ffc256f3
|
@ -1209,7 +1209,10 @@ void GeneratedPDFObject::generateSourceCodeImpl(QTextStream& stream, CodeGenerat
|
|||
if (pass == Pass::Enter)
|
||||
{
|
||||
stream << indent << "objectBuilder.beginArray();" << Qt::endl;
|
||||
stream << indent << writeTo << getValue().trimmed() << ";" << Qt::endl;
|
||||
for (const QString& arrayPart : getValue().trimmed().split(";"))
|
||||
{
|
||||
stream << indent << writeTo << arrayPart << ";" << Qt::endl;
|
||||
}
|
||||
stream << indent << "objectBuilder.endArray();" << Qt::endl;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -144,7 +144,8 @@ public:
|
|||
_QPointF,
|
||||
_QRectF,
|
||||
_QColor,
|
||||
_QVariant
|
||||
_QVariant,
|
||||
_TextAnnotationIcon
|
||||
};
|
||||
Q_ENUM(DataType)
|
||||
|
||||
|
|
|
@ -24,7 +24,31 @@ void PDFExamplesGenerator::generateAnnotationsExample()
|
|||
{
|
||||
pdf::PDFDocumentBuilder builder;
|
||||
|
||||
builder.appendPage(QRectF(0, 0, 400, 400));
|
||||
pdf::PDFObjectReference page1 = builder.appendPage(QRectF(0, 0, 400, 400));
|
||||
builder.createAnnotationText(page1, QRectF(50, 50, 24, 24), pdf::TextAnnotationIcon::Comment, "Title1", "Subject1", "Comment", false);
|
||||
builder.createAnnotationText(page1, QRectF(50, 100, 24, 24), pdf::TextAnnotationIcon::Help, "Title1", "Subject1", "Help", false);
|
||||
builder.createAnnotationText(page1, QRectF(50, 150, 24, 24), pdf::TextAnnotationIcon::Insert, "Title1", "Subject1", "Insert", false);
|
||||
builder.createAnnotationText(page1, QRectF(50, 200, 24, 24), pdf::TextAnnotationIcon::Key, "Title1", "Subject1", "Key", false);
|
||||
builder.createAnnotationText(page1, QRectF(50, 250, 24, 24), pdf::TextAnnotationIcon::NewParagraph, "Title1", "Subject1", "NewParagraph", false);
|
||||
builder.createAnnotationText(page1, QRectF(50, 300, 24, 24), pdf::TextAnnotationIcon::Note, "Title1", "Subject1", "Note", false);
|
||||
builder.createAnnotationText(page1, QRectF(50, 350, 24, 24), pdf::TextAnnotationIcon::Paragraph, "Title1", "Subject1", "Paragraph", false);
|
||||
builder.createAnnotationText(page1, QRectF(250, 50, 24, 24), pdf::TextAnnotationIcon::Comment, "Title1", "Subject1", "Comment", true);
|
||||
builder.createAnnotationText(page1, QRectF(250, 100, 24, 24), pdf::TextAnnotationIcon::Help, "Title1", "Subject1", "Help", true);
|
||||
builder.createAnnotationText(page1, QRectF(250, 150, 24, 24), pdf::TextAnnotationIcon::Insert, "Title1", "Subject1", "Insert", true);
|
||||
builder.createAnnotationText(page1, QRectF(250, 200, 24, 24), pdf::TextAnnotationIcon::Key, "Title1", "Subject1", "Key", true);
|
||||
builder.createAnnotationText(page1, QRectF(250, 250, 24, 24), pdf::TextAnnotationIcon::NewParagraph, "Title1", "Subject1", "NewParagraph", true);
|
||||
builder.createAnnotationText(page1, QRectF(250, 300, 24, 24), pdf::TextAnnotationIcon::Note, "Title1", "Subject1", "Note", true);
|
||||
builder.createAnnotationText(page1, QRectF(250, 350, 24, 24), pdf::TextAnnotationIcon::Paragraph, "Title1", "Subject1", "Paragraph", true);
|
||||
|
||||
pdf::PDFObjectReference page5 = builder.appendPage(QRectF(0, 0, 400, 400));
|
||||
builder.createAnnotationSquare(page5, QRectF(50, 50, 50, 50), 3.0, Qt::green, Qt::red, "Title1", "Subject1", "Contents - green filling, red boundary");
|
||||
builder.createAnnotationSquare(page5, QRectF(50, 150, 50, 50), 3.0, QColor(), Qt::red, "Title2", "Subject2", "Contents - red boundary");
|
||||
builder.createAnnotationSquare(page5, QRectF(50, 250, 50, 50), 3.0, Qt::green, QColor(), "Title3", "Subject3", "Contents - green filling");
|
||||
|
||||
pdf::PDFObjectReference page6 = builder.appendPage(QRectF(0, 0, 400, 400));
|
||||
builder.createAnnotationCircle(page6, QRectF(50, 50, 50, 50), 3.0, Qt::green, Qt::red, "Title1", "Subject1", "Contents - green filling, red boundary");
|
||||
builder.createAnnotationCircle(page6, QRectF(50, 150, 50, 50), 3.0, QColor(), Qt::red, "Title2", "Subject2", "Contents - red boundary");
|
||||
builder.createAnnotationCircle(page6, QRectF(50, 250, 50, 50), 3.0, Qt::green, QColor(), "Title3", "Subject3", "Contents - green filling");
|
||||
|
||||
// Write result to a file
|
||||
pdf::PDFDocument document = builder.build();
|
||||
|
|
|
@ -508,6 +508,17 @@ private:
|
|||
PDFObject m_externalData;
|
||||
};
|
||||
|
||||
enum class TextAnnotationIcon
|
||||
{
|
||||
Comment,
|
||||
Help,
|
||||
Insert,
|
||||
Key,
|
||||
NewParagraph,
|
||||
Note,
|
||||
Paragraph
|
||||
};
|
||||
|
||||
/// Text annotation represents note attached to a specific point in the PDF
|
||||
/// document. It appears as icon, and it is not zoomed, or rotated (behaves
|
||||
/// as if flag NoZoom and NoRotate were set). When this annotation is opened,
|
||||
|
|
|
@ -64,6 +64,61 @@ void PDFObjectFactory::endDictionaryItem()
|
|||
std::get<PDFDictionary>(dictionaryItem.object).addEntry(qMove(topItem.itemName), qMove(std::get<PDFObject>(topItem.object)));
|
||||
}
|
||||
|
||||
PDFObjectFactory& PDFObjectFactory::operator<<(TextAnnotationIcon icon)
|
||||
{
|
||||
switch (icon)
|
||||
{
|
||||
case TextAnnotationIcon::Comment:
|
||||
{
|
||||
*this << WrapName("Comment");
|
||||
break;
|
||||
}
|
||||
|
||||
case TextAnnotationIcon::Help:
|
||||
{
|
||||
*this << WrapName("Help");
|
||||
break;
|
||||
}
|
||||
|
||||
case TextAnnotationIcon::Insert:
|
||||
{
|
||||
*this << WrapName("Insert");
|
||||
break;
|
||||
}
|
||||
|
||||
case TextAnnotationIcon::Key:
|
||||
{
|
||||
*this << WrapName("Key");
|
||||
break;
|
||||
}
|
||||
|
||||
case TextAnnotationIcon::NewParagraph:
|
||||
{
|
||||
*this << WrapName("NewParagraph");
|
||||
break;
|
||||
}
|
||||
|
||||
case TextAnnotationIcon::Note:
|
||||
{
|
||||
*this << WrapName("Note");
|
||||
break;
|
||||
}
|
||||
|
||||
case TextAnnotationIcon::Paragraph:
|
||||
{
|
||||
*this << WrapName("Paragraph");
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
PDFObjectFactory& PDFObjectFactory::operator<<(WrapEmptyArray)
|
||||
{
|
||||
beginArray();
|
||||
|
@ -276,7 +331,9 @@ void PDFDocumentBuilder::appendTo(PDFObjectReference reference, PDFObject object
|
|||
|
||||
QRectF PDFDocumentBuilder::getPopupWindowRect(const QRectF& rectangle) const
|
||||
{
|
||||
return rectangle.translated(rectangle.width() * 1.25, 0);
|
||||
QRectF rect = rectangle.translated(rectangle.width() * 1.25, 0);
|
||||
rect.setSize(QSizeF(100, 100));
|
||||
return rect;
|
||||
}
|
||||
|
||||
QString PDFDocumentBuilder::getProducerString() const
|
||||
|
@ -375,7 +432,17 @@ PDFObjectReference PDFDocumentBuilder::createAnnotationSquare(PDFObjectReference
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -532,6 +599,148 @@ PDFObjectReference PDFDocumentBuilder::createCatalogPageTreeRoot()
|
|||
}
|
||||
|
||||
|
||||
PDFObjectReference PDFDocumentBuilder::createAnnotationCircle(PDFObjectReference page,
|
||||
QRectF rectangle,
|
||||
PDFReal borderWidth,
|
||||
QColor fillColor,
|
||||
QColor strokeColor,
|
||||
QString title,
|
||||
QString subject,
|
||||
QString contents)
|
||||
{
|
||||
PDFObjectFactory objectBuilder;
|
||||
|
||||
objectBuilder.beginDictionary();
|
||||
objectBuilder.beginDictionaryItem("Subtype");
|
||||
objectBuilder << WrapName("Circle");
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("Rect");
|
||||
objectBuilder << rectangle;
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("F");
|
||||
objectBuilder << 4;
|
||||
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("Border");
|
||||
objectBuilder << std::initializer_list<PDFReal>{ 0.0, 0.0, borderWidth };
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("C");
|
||||
objectBuilder << WrapAnnotationColor(strokeColor);
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("IC");
|
||||
objectBuilder << WrapAnnotationColor(fillColor);
|
||||
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());
|
||||
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::createAnnotationText(PDFObjectReference page,
|
||||
QRectF rectangle,
|
||||
TextAnnotationIcon iconType,
|
||||
QString title,
|
||||
QString subject,
|
||||
QString contents,
|
||||
bool open)
|
||||
{
|
||||
PDFObjectFactory objectBuilder;
|
||||
|
||||
objectBuilder.beginDictionary();
|
||||
objectBuilder.beginDictionaryItem("Subtype");
|
||||
objectBuilder << WrapName("Text");
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("Rect");
|
||||
objectBuilder << rectangle;
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("Name");
|
||||
objectBuilder << iconType;
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("F");
|
||||
objectBuilder << 4;
|
||||
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("T");
|
||||
objectBuilder << title;
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("Contents");
|
||||
objectBuilder << contents;
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("Subj");
|
||||
objectBuilder << subject;
|
||||
objectBuilder.endDictionaryItem();
|
||||
objectBuilder.beginDictionaryItem("Open");
|
||||
objectBuilder << open;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/* END GENERATED CODE */
|
||||
|
||||
} // namespace pdf
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "pdfobject.h"
|
||||
#include "pdfdocument.h"
|
||||
#include "pdfannotation.h"
|
||||
|
||||
namespace pdf
|
||||
{
|
||||
|
@ -77,6 +78,7 @@ public:
|
|||
PDFObjectFactory& operator<<(WrapAnnotationColor color);
|
||||
PDFObjectFactory& operator<<(QString textString);
|
||||
PDFObjectFactory& operator<<(WrapEmptyArray);
|
||||
PDFObjectFactory& operator<<(TextAnnotationIcon icon);
|
||||
|
||||
/// Treat containers - write them as array
|
||||
template<typename Container, typename ValueType = decltype(*std::begin(std::declval<Container>()))>
|
||||
|
@ -244,6 +246,49 @@ public:
|
|||
PDFObjectReference createCatalogPageTreeRoot();
|
||||
|
||||
|
||||
/// 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.
|
||||
/// \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
|
||||
/// \param fillColor Fill color of rectangle (interior color). If you do not want to have area color filled,
|
||||
/// then use invalid QColor.
|
||||
/// \param strokeColor Stroke color (color of the rectangle border). If you do not want to have a
|
||||
/// border, then use invalid QColor.
|
||||
/// \param title Title (it is displayed as title of popup window)
|
||||
/// \param subject Subject (short description of the subject being adressed by the annotation)
|
||||
/// \param contents Contents (text displayed, for example, in the marked annotation dialog)
|
||||
PDFObjectReference createAnnotationCircle(PDFObjectReference page,
|
||||
QRectF rectangle,
|
||||
PDFReal borderWidth,
|
||||
QColor fillColor,
|
||||
QColor strokeColor,
|
||||
QString title,
|
||||
QString subject,
|
||||
QString contents);
|
||||
|
||||
|
||||
/// 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.
|
||||
/// \param page Page to which is annotation added
|
||||
/// \param rectangle Area in which is icon displayed
|
||||
/// \param iconType Icon type
|
||||
/// \param title Title (it is displayed as title of popup window)
|
||||
/// \param subject Subject (short description of the subject being adressed by the annotation)
|
||||
/// \param contents Contents (text displayed, for example, in the marked annotation dialog)
|
||||
/// \param open Is annotation initiali displayed as opened?
|
||||
PDFObjectReference createAnnotationText(PDFObjectReference page,
|
||||
QRectF rectangle,
|
||||
TextAnnotationIcon iconType,
|
||||
QString title,
|
||||
QString subject,
|
||||
QString contents,
|
||||
bool open);
|
||||
|
||||
|
||||
/* END GENERATED CODE */
|
||||
|
||||
private:
|
||||
|
|
|
@ -203,6 +203,38 @@
|
|||
<property name="variableType">_PDFObject</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName"></property>
|
||||
<property name="objectType">ArraySimple</property>
|
||||
<property name="value">annotationObject;popupAnnotation</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName">Annots</property>
|
||||
<property name="objectType">DictionaryItemComplex</property>
|
||||
<property name="value"></property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName"></property>
|
||||
<property name="objectType">Dictionary</property>
|
||||
<property name="value"></property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="actionType">CreateObject</property>
|
||||
<property name="variableName">pageAnnots</property>
|
||||
<property name="variableType">_PDFObject</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
|
@ -210,6 +242,7 @@
|
|||
<property name="variableName"></property>
|
||||
<property name="variableType">_void</property>
|
||||
<property name="code">mergeTo(annotationObject, updateAnnotationPopup);
|
||||
appendTo(page, pageAnnots);
|
||||
return annotationObject;</property>
|
||||
</QObject>
|
||||
</property>
|
||||
|
@ -725,5 +758,489 @@ return pageReference;</property>
|
|||
<property name="functionDescription">Creates page tree root for the catalog. This function is only called when new document is being created. Do not call this function manually.</property>
|
||||
<property name="returnType">_PDFObjectReference</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedFunction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">page</property>
|
||||
<property name="parameterType">_PDFObjectReference</property>
|
||||
<property name="parameterDescription">Page to which is annotation added</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">rectangle</property>
|
||||
<property name="parameterType">_QRectF</property>
|
||||
<property name="parameterDescription">Area in which is circle/ellipse displayed</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">borderWidth</property>
|
||||
<property name="parameterType">_PDFReal</property>
|
||||
<property name="parameterDescription">Width of the border line of circle/ellipse</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">fillColor</property>
|
||||
<property name="parameterType">_QColor</property>
|
||||
<property name="parameterDescription">Fill color of rectangle (interior color). If you do not want to have area color filled, then use invalid QColor.</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">strokeColor</property>
|
||||
<property name="parameterType">_QColor</property>
|
||||
<property name="parameterDescription">Stroke color (color of the rectangle border). If you do not want to have a border, then use invalid QColor.</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">title</property>
|
||||
<property name="parameterType">_QString</property>
|
||||
<property name="parameterDescription">Title (it is displayed as title of popup window)</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">subject</property>
|
||||
<property name="parameterType">_QString</property>
|
||||
<property name="parameterDescription">Subject (short description of the subject being adressed by the annotation)</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">contents</property>
|
||||
<property name="parameterType">_QString</property>
|
||||
<property name="parameterDescription">Contents (text displayed, for example, in the marked annotation dialog)</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="actionType">Parameters</property>
|
||||
<property name="variableName"></property>
|
||||
<property name="variableType">_void</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Subtype</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">WrapName("Circle")</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Rect</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">rectangle</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">F</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">4</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">P</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">page</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">M</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">WrapCurrentDateTime()</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">CreationDate</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">WrapCurrentDateTime()</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Border</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">std::initializer_list<PDFReal>{ 0.0, 0.0, borderWidth }</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">C</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">WrapAnnotationColor(strokeColor)</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">IC</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">WrapAnnotationColor(fillColor)</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">T</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">title</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Contents</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">contents</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Subj</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">subject</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName"></property>
|
||||
<property name="objectType">Dictionary</property>
|
||||
<property name="value"></property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="actionType">CreateObject</property>
|
||||
<property name="variableName">annotationObject</property>
|
||||
<property name="variableType">_PDFObjectReference</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="actionType">Code</property>
|
||||
<property name="variableName"></property>
|
||||
<property name="variableType">_void</property>
|
||||
<property name="code">PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(rectangle), false);</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Popup</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">popupAnnotation</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName">Popup</property>
|
||||
<property name="objectType">Dictionary</property>
|
||||
<property name="value">popupAnnotation</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="actionType">CreateObject</property>
|
||||
<property name="variableName">updateAnnotationPopup</property>
|
||||
<property name="variableType">_PDFObject</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName"></property>
|
||||
<property name="objectType">ArraySimple</property>
|
||||
<property name="value">annotationObject;popupAnnotation</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName">Annots</property>
|
||||
<property name="objectType">DictionaryItemComplex</property>
|
||||
<property name="value"></property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName"></property>
|
||||
<property name="objectType">Dictionary</property>
|
||||
<property name="value"></property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="actionType">CreateObject</property>
|
||||
<property name="variableName">pageAnnots</property>
|
||||
<property name="variableType">_PDFObject</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="actionType">Code</property>
|
||||
<property name="variableName"></property>
|
||||
<property name="variableType">_void</property>
|
||||
<property name="code">mergeTo(annotationObject, updateAnnotationPopup);
|
||||
appendTo(page, pageAnnots);
|
||||
return annotationObject;</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="functionType">Annotations</property>
|
||||
<property name="functionName">createAnnotationCircle</property>
|
||||
<property name="functionDescription">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.</property>
|
||||
<property name="returnType">_PDFObjectReference</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedFunction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">page</property>
|
||||
<property name="parameterType">_PDFObjectReference</property>
|
||||
<property name="parameterDescription">Page to which is annotation added</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">rectangle</property>
|
||||
<property name="parameterType">_QRectF</property>
|
||||
<property name="parameterDescription">Area in which is icon displayed</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">iconType</property>
|
||||
<property name="parameterType">_TextAnnotationIcon</property>
|
||||
<property name="parameterDescription">Icon type</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">title</property>
|
||||
<property name="parameterType">_QString</property>
|
||||
<property name="parameterDescription">Title (it is displayed as title of popup window)</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">subject</property>
|
||||
<property name="parameterType">_QString</property>
|
||||
<property name="parameterDescription">Subject (short description of the subject being adressed by the annotation)</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">contents</property>
|
||||
<property name="parameterType">_QString</property>
|
||||
<property name="parameterDescription">Contents (text displayed, for example, in the marked annotation dialog)</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedParameter">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="parameterName">open</property>
|
||||
<property name="parameterType">_bool</property>
|
||||
<property name="parameterDescription">Is annotation initiali displayed as opened?</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="actionType">Parameters</property>
|
||||
<property name="variableName"></property>
|
||||
<property name="variableType">_void</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Subtype</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">WrapName("Text")</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Rect</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">rectangle</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Name</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">iconType</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">F</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">4</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">P</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">page</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">M</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">WrapCurrentDateTime()</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">CreationDate</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">WrapCurrentDateTime()</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">T</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">title</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Contents</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">contents</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Subj</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">subject</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Open</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">open</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName"></property>
|
||||
<property name="objectType">Dictionary</property>
|
||||
<property name="value"></property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="actionType">CreateObject</property>
|
||||
<property name="variableName">annotationObject</property>
|
||||
<property name="variableType">_PDFObjectReference</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="actionType">Code</property>
|
||||
<property name="variableName"></property>
|
||||
<property name="variableType">_void</property>
|
||||
<property name="code">PDFObjectReference popupAnnotation = createAnnotationPopup(page, annotationObject, getPopupWindowRect(rectangle), false);</property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName">Popup</property>
|
||||
<property name="objectType">DictionaryItemSimple</property>
|
||||
<property name="value">popupAnnotation</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName">Popup</property>
|
||||
<property name="objectType">Dictionary</property>
|
||||
<property name="value">popupAnnotation</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="actionType">CreateObject</property>
|
||||
<property name="variableName">updateAnnotationPopup</property>
|
||||
<property name="variableType">_PDFObject</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items">
|
||||
<QObject class="codegen::GeneratedPDFObject">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="dictionaryItemName"></property>
|
||||
<property name="objectType">ArraySimple</property>
|
||||
<property name="value">annotationObject;popupAnnotation</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName">Annots</property>
|
||||
<property name="objectType">DictionaryItemComplex</property>
|
||||
<property name="value"></property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="dictionaryItemName"></property>
|
||||
<property name="objectType">Dictionary</property>
|
||||
<property name="value"></property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="actionType">CreateObject</property>
|
||||
<property name="variableName">pageAnnots</property>
|
||||
<property name="variableType">_PDFObject</property>
|
||||
<property name="code"></property>
|
||||
</QObject>
|
||||
<QObject class="codegen::GeneratedAction">
|
||||
<property name="objectName"></property>
|
||||
<property name="items"/>
|
||||
<property name="actionType">Code</property>
|
||||
<property name="variableName"></property>
|
||||
<property name="variableType">_void</property>
|
||||
<property name="code">mergeTo(annotationObject, updateAnnotationPopup);
|
||||
appendTo(page, pageAnnots);
|
||||
return annotationObject;</property>
|
||||
</QObject>
|
||||
</property>
|
||||
<property name="functionType">Annotations</property>
|
||||
<property name="functionName">createAnnotationText</property>
|
||||
<property name="functionDescription">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.</property>
|
||||
<property name="returnType">_PDFObjectReference</property>
|
||||
</QObject>
|
||||
</property>
|
||||
</root>
|
||||
|
|
Loading…
Reference in New Issue