Signature plugin: visible digital signatures

This commit is contained in:
Jakub Melka 2022-05-29 17:27:58 +02:00
parent c7e7b76e5b
commit b46ff4f63c
6 changed files with 380 additions and 117 deletions

View File

@ -4567,6 +4567,46 @@ PDFObjectReference PDFDocumentBuilder::createFormFieldSignature(QString fieldNam
} }
void PDFDocumentBuilder::createFormFieldWidget(PDFObjectReference formField,
PDFObjectReference page,
PDFObjectReference appearanceStream,
QRectF rect)
{
PDFObjectFactory objectBuilder;
objectBuilder.beginDictionary();
objectBuilder.beginDictionaryItem("Type");
objectBuilder << WrapName("Annot");
objectBuilder.endDictionaryItem();
objectBuilder.beginDictionaryItem("Subtype");
objectBuilder << WrapName("Widget");
objectBuilder.endDictionaryItem();
objectBuilder.beginDictionaryItem("P");
objectBuilder << page;
objectBuilder.endDictionaryItem();
objectBuilder.beginDictionaryItem("Rect");
objectBuilder << rect;
objectBuilder.endDictionaryItem();
objectBuilder.beginDictionaryItem("AP");
objectBuilder.beginDictionary();
objectBuilder.beginDictionaryItem("N");
objectBuilder << appearanceStream;
objectBuilder.endDictionaryItem();
objectBuilder.endDictionary();
objectBuilder.endDictionaryItem();
objectBuilder.endDictionary();
PDFObject widgetObject = objectBuilder.takeObject();
objectBuilder.beginDictionary();
objectBuilder.beginDictionaryItem("Annots");
objectBuilder << std::array{ formField };
objectBuilder.endDictionaryItem();
objectBuilder.endDictionary();
PDFObject pageObject = objectBuilder.takeObject();
mergeTo(formField, widgetObject);
appendTo(page, pageObject);
}
void PDFDocumentBuilder::createInvisibleFormFieldWidget(PDFObjectReference formField, void PDFDocumentBuilder::createInvisibleFormFieldWidget(PDFObjectReference formField,
PDFObjectReference page) PDFObjectReference page)
{ {
@ -5131,6 +5171,14 @@ void PDFDocumentBuilder::setFormFieldValue(PDFObjectReference formField,
} }
void PDFDocumentBuilder::setLanguage(QLocale locale)
{
PDFObjectFactory objectBuilder;
setLanguage(locale.name());
}
void PDFDocumentBuilder::setLanguage(QString language) void PDFDocumentBuilder::setLanguage(QString language)
{ {
PDFObjectFactory objectBuilder; PDFObjectFactory objectBuilder;
@ -5145,14 +5193,6 @@ void PDFDocumentBuilder::setLanguage(QString language)
} }
void PDFDocumentBuilder::setLanguage(QLocale locale)
{
PDFObjectFactory objectBuilder;
setLanguage(locale.name());
}
void PDFDocumentBuilder::setOutline(PDFObjectReference outline) void PDFDocumentBuilder::setOutline(PDFObjectReference outline)
{ {
PDFObjectFactory objectBuilder; PDFObjectFactory objectBuilder;

View File

@ -92,7 +92,7 @@ struct WrapEmptyArray { };
/// Factory for creating various PDF objects, such as simple objects, /// Factory for creating various PDF objects, such as simple objects,
/// dictionaries, arrays etc. /// dictionaries, arrays etc.
class PDFObjectFactory class PDF4QTLIBSHARED_EXPORT PDFObjectFactory
{ {
public: public:
inline explicit PDFObjectFactory() = default; inline explicit PDFObjectFactory() = default;
@ -1235,6 +1235,17 @@ public:
PDFObjectReference signatureValue); PDFObjectReference signatureValue);
/// Creates visible form field widget without contents.
/// \param formField Form field reference
/// \param page Page reference
/// \param appearanceStream Appearance stream
/// \param rect Widget rectangle
void createFormFieldWidget(PDFObjectReference formField,
PDFObjectReference page,
PDFObjectReference appearanceStream,
QRectF rect);
/// ///
/// \param formField Form field reference /// \param formField Form field reference
/// \param page Page reference /// \param page Page reference
@ -1457,6 +1468,11 @@ public:
PDFObject value); PDFObject value);
/// Set document language.
/// \param locale Locale, from which is language determined
void setLanguage(QLocale locale);
/// Set document language. /// Set document language.
/// \param language Document language. It should be a language identifier, as defined in ISO 639 /// \param language Document language. It should be a language identifier, as defined in ISO 639
/// and ISO 3166. For example, "en-US", where first two letter means language code (en = /// and ISO 3166. For example, "en-US", where first two letter means language code (en =
@ -1464,11 +1480,6 @@ public:
void setLanguage(QString language); void setLanguage(QString language);
/// Set document language.
/// \param locale Locale, from which is language determined
void setLanguage(QLocale locale);
/// Set document outline. /// Set document outline.
/// \param outline Document outline root /// \param outline Document outline root
void setOutline(PDFObjectReference outline); void setOutline(PDFObjectReference outline);

View File

@ -889,6 +889,21 @@ std::set<PDFInteger> PDFPageContentScene::getPageIndices() const
return result; return result;
} }
QRectF PDFPageContentScene::getBoundingBox(PDFInteger pageIndex) const
{
QRectF rect;
for (const auto& element : m_elements)
{
if (element->getPageIndex() == pageIndex)
{
rect = rect.united(element->getBoundingBox());
}
}
return rect;
}
void PDFPageContentScene::setSelectedElementIds(const std::set<PDFInteger>& selectedElementIds) void PDFPageContentScene::setSelectedElementIds(const std::set<PDFInteger>& selectedElementIds)
{ {
m_manipulator.selectNew(selectedElementIds); m_manipulator.selectNew(selectedElementIds);

View File

@ -507,6 +507,9 @@ public:
/// Returns set of involved pages /// Returns set of involved pages
std::set<PDFInteger> getPageIndices() const; std::set<PDFInteger> getPageIndices() const;
/// Returns bounding box of elements on page
QRectF getBoundingBox(PDFInteger pageIndex) const;
/// Set selected items /// Set selected items
void setSelectedElementIds(const std::set<PDFInteger>& selectedElementIds); void setSelectedElementIds(const std::set<PDFInteger>& selectedElementIds);

View File

@ -346,15 +346,62 @@ void SignaturePlugin::onSignDigitally()
pdf::PDFObjectReference formField = builder.createFormFieldSignature(signatureName, { }, signatureDictionary); pdf::PDFObjectReference formField = builder.createFormFieldSignature(signatureName, { }, signatureDictionary);
builder.createAcroForm({ formField }); builder.createAcroForm({ formField });
const pdf::PDFCatalog* catalog = m_document->getCatalog();
if (dialog.getSignMethod() == SignDialog::SignDigitallyInvisible) if (dialog.getSignMethod() == SignDialog::SignDigitallyInvisible)
{ {
const pdf::PDFCatalog* catalog = m_document->getCatalog();
if (catalog->getPageCount() > 0) if (catalog->getPageCount() > 0)
{ {
const pdf::PDFObjectReference pageReference = catalog->getPage(0)->getPageReference(); const pdf::PDFObjectReference pageReference = catalog->getPage(0)->getPageReference();
builder.createInvisibleFormFieldWidget(formField, pageReference); builder.createInvisibleFormFieldWidget(formField, pageReference);
} }
} }
else if (dialog.getSignMethod() == SignDialog::SignDigitally)
{
Q_ASSERT(!m_scene.isEmpty());
const pdf::PDFInteger pageIndex = *m_scene.getPageIndices().begin();
const pdf::PDFPage* page = catalog->getPage(pageIndex);
pdf::PDFContentStreamBuilder contentBuilder(page->getMediaBox().size(), pdf::PDFContentStreamBuilder::CoordinateSystem::PDF);
QPainter* painter = contentBuilder.begin();
QList<pdf::PDFRenderError> errors;
pdf::PDFTextLayoutGetter nullGetter(nullptr, pageIndex);
m_scene.drawPage(painter, pageIndex, nullptr, nullGetter, QMatrix(), errors);
pdf::PDFContentStreamBuilder::ContentStream contentStream = contentBuilder.end(painter);
QRectF boundingRect = m_scene.getBoundingBox(pageIndex);
std::vector<pdf::PDFObject> copiedObjects = builder.copyFrom({ contentStream.resources, contentStream.contents }, contentStream.document.getStorage(), true);
Q_ASSERT(copiedObjects.size() == 2);
pdf::PDFObjectReference resourcesReference = copiedObjects[0].getReference();
pdf::PDFObjectReference formReference = copiedObjects[1].getReference();
// Create form object
pdf::PDFObjectFactory formFactory;
formFactory.beginDictionary();
formFactory.beginDictionaryItem("Type");
formFactory << pdf::WrapName("XObject");
formFactory.endDictionaryItem();
formFactory.beginDictionaryItem("Subtype");
formFactory << pdf::WrapName("Form");
formFactory.endDictionaryItem();
formFactory.beginDictionaryItem("BBox");
formFactory << boundingRect;
formFactory.endDictionaryItem();
formFactory.beginDictionaryItem("Resources");
formFactory << resourcesReference;
formFactory.endDictionaryItem();
formFactory.endDictionary();
builder.mergeTo(formReference, formFactory.takeObject());
builder.createFormFieldWidget(formField, page->getPageReference(), formReference, boundingRect);
}
QString reasonText = dialog.getReasonText(); QString reasonText = dialog.getReasonText();
if (!reasonText.isEmpty()) if (!reasonText.isEmpty())

View File

@ -103,7 +103,7 @@
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(getPageTreeRoot(), updatedTreeRoot);&#xd; <property name="code">appendTo(getPageTreeRoot(), updatedTreeRoot);&#xd;&#xd;
return pageReference;</property> return pageReference;</property>
</QObject> </QObject>
</property> </property>
@ -182,7 +182,7 @@ return pageReference;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">setCatalogAcroForm(acroForm);&#xd; <property name="code">setCatalogAcroForm(acroForm);&#xd;&#xd;
return acroForm;</property> return acroForm;</property>
</QObject> </QObject>
</property> </property>
@ -2386,8 +2386,8 @@ return acroForm;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -2610,8 +2610,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -2785,8 +2785,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationReference);&#xd; updateAnnotationAppearanceStreams(annotationReference);&#xd;&#xd;
return annotationReference;</property> return annotationReference;</property>
</QObject> </QObject>
</property> </property>
@ -3067,8 +3067,8 @@ return annotationReference;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -3270,8 +3270,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -3545,8 +3545,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -3749,8 +3749,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -3904,8 +3904,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -4044,8 +4044,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -4269,8 +4269,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -4486,8 +4486,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -4768,8 +4768,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -5120,8 +5120,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -5321,8 +5321,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationReference);&#xd; updateAnnotationAppearanceStreams(annotationReference);&#xd;&#xd;
return annotationReference;</property> return annotationReference;</property>
</QObject> </QObject>
</property> </property>
@ -5552,8 +5552,8 @@ return annotationReference;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -5812,8 +5812,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -5951,8 +5951,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">mergeTo(parentAnnotation, upgradedParentAnnotation);&#xd; <property name="code">mergeTo(parentAnnotation, upgradedParentAnnotation);&#xd;&#xd;
updateAnnotationAppearanceStreams(popupAnnotation);&#xd; updateAnnotationAppearanceStreams(popupAnnotation);&#xd;&#xd;
return popupAnnotation;</property> return popupAnnotation;</property>
</QObject> </QObject>
</property> </property>
@ -6106,8 +6106,8 @@ return popupAnnotation;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -6246,8 +6246,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -6470,8 +6470,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -6625,8 +6625,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -6765,8 +6765,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -6969,8 +6969,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -7158,8 +7158,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -7362,8 +7362,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -7517,8 +7517,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -7657,8 +7657,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -7899,9 +7899,9 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">mergeTo(annotationObject, updateAnnotationPopup);&#xd; <property name="code">mergeTo(annotationObject, updateAnnotationPopup);&#xd;&#xd;
appendTo(page, pageAnnots);&#xd; appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -8055,8 +8055,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -8195,8 +8195,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -8399,8 +8399,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">appendTo(page, pageAnnots);&#xd; <property name="code">appendTo(page, pageAnnots);&#xd;&#xd;
updateAnnotationAppearanceStreams(annotationObject);&#xd; updateAnnotationAppearanceStreams(annotationObject);&#xd;&#xd;
return annotationObject;</property> return annotationObject;</property>
</QObject> </QObject>
</property> </property>
@ -8716,8 +8716,8 @@ return annotationObject;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">mergeTo(rootNodeReference, updatedRootNode);&#xd; <property name="code">mergeTo(rootNodeReference, updatedRootNode);&#xd;&#xd;
mergeTo(getCatalogReference(), updatedCatalog);&#xd; mergeTo(getCatalogReference(), updatedCatalog);&#xd;&#xd;
return rootNodeReference;</property> return rootNodeReference;</property>
</QObject> </QObject>
</property> </property>
@ -8946,6 +8946,153 @@ return rootNodeReference;</property>
<property name="functionDescription">Creates form field of type signature.</property> <property name="functionDescription">Creates form field of type signature.</property>
<property name="returnType">_PDFObjectReference</property> <property name="returnType">_PDFObjectReference</property>
</QObject> </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">formField</property>
<property name="parameterType">_PDFObjectReference</property>
<property name="parameterDescription">Form field reference</property>
</QObject>
<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 reference</property>
</QObject>
<QObject class="codegen::GeneratedParameter">
<property name="objectName"></property>
<property name="items"/>
<property name="parameterName">appearanceStream</property>
<property name="parameterType">_PDFObjectReference</property>
<property name="parameterDescription">Appearance stream</property>
</QObject>
<QObject class="codegen::GeneratedParameter">
<property name="objectName"></property>
<property name="items"/>
<property name="parameterName">rect</property>
<property name="parameterType">_QRectF</property>
<property name="parameterDescription">Widget rectangle</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">Type</property>
<property name="objectType">DictionaryItemSimple</property>
<property name="value">WrapName("Annot")</property>
</QObject>
<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("Widget")</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">Rect</property>
<property name="objectType">DictionaryItemSimple</property>
<property name="value">rect</property>
</QObject>
<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">N</property>
<property name="objectType">DictionaryItemSimple</property>
<property name="value">appearanceStream</property>
</QObject>
</property>
<property name="dictionaryItemName"></property>
<property name="objectType">Dictionary</property>
<property name="value"></property>
</QObject>
</property>
<property name="dictionaryItemName">AP</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">widgetObject</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"/>
<property name="dictionaryItemName">Annots</property>
<property name="objectType">DictionaryItemSimple</property>
<property name="value">std::array{ formField }</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">pageObject</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(formField, widgetObject);&#xd;
appendTo(page, pageObject);</property>
</QObject>
</property>
<property name="functionType">Structure</property>
<property name="functionName">createFormFieldWidget</property>
<property name="functionDescription">Creates visible form field widget without contents.</property>
<property name="returnType">_void</property>
</QObject>
<QObject class="codegen::GeneratedFunction"> <QObject class="codegen::GeneratedFunction">
<property name="objectName"></property> <property name="objectName"></property>
<property name="items"> <property name="items">
@ -9047,7 +9194,7 @@ return rootNodeReference;</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">mergeTo(formField, widgetObject); <property name="code">mergeTo(formField, widgetObject);&#xd;
appendTo(page, pageObject);</property> appendTo(page, pageObject);</property>
</QObject> </QObject>
</property> </property>
@ -11140,6 +11287,39 @@ appendTo(page, pageObject);</property>
<property name="functionDescription">Sets form field value. Value must be correct for this form field, no checking is performed. Also, if you use this function, annotation widgets, which are attached to this form field, should also be updated (for example, appearance state and sometimes appearance streams).</property> <property name="functionDescription">Sets form field value. Value must be correct for this form field, no checking is performed. Also, if you use this function, annotation widgets, which are attached to this form field, should also be updated (for example, appearance state and sometimes appearance streams).</property>
<property name="returnType">_void</property> <property name="returnType">_void</property>
</QObject> </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">locale</property>
<property name="parameterType">_QLocale</property>
<property name="parameterDescription">Locale, from which is language determined</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"/>
<property name="actionType">Code</property>
<property name="variableName"></property>
<property name="variableType">_void</property>
<property name="code">setLanguage(locale.name());</property>
</QObject>
</property>
<property name="functionType">Structure</property>
<property name="functionName">setLanguage</property>
<property name="functionDescription">Set document language.</property>
<property name="returnType">_void</property>
</QObject>
<QObject class="codegen::GeneratedFunction"> <QObject class="codegen::GeneratedFunction">
<property name="objectName"></property> <property name="objectName"></property>
<property name="items"> <property name="items">
@ -11197,39 +11377,6 @@ appendTo(page, pageObject);</property>
<property name="functionDescription">Set document language.</property> <property name="functionDescription">Set document language.</property>
<property name="returnType">_void</property> <property name="returnType">_void</property>
</QObject> </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">locale</property>
<property name="parameterType">_QLocale</property>
<property name="parameterDescription">Locale, from which is language determined</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"/>
<property name="actionType">Code</property>
<property name="variableName"></property>
<property name="variableType">_void</property>
<property name="code">setLanguage(locale.name());</property>
</QObject>
</property>
<property name="functionType">Structure</property>
<property name="functionName">setLanguage</property>
<property name="functionDescription">Set document language.</property>
<property name="returnType">_void</property>
</QObject>
<QObject class="codegen::GeneratedFunction"> <QObject class="codegen::GeneratedFunction">
<property name="objectName"></property> <property name="objectName"></property>
<property name="items"> <property name="items">
@ -12007,7 +12154,7 @@ appendTo(page, pageObject);</property>
<property name="actionType">Code</property> <property name="actionType">Code</property>
<property name="variableName"></property> <property name="variableName"></property>
<property name="variableType">_void</property> <property name="variableType">_void</property>
<property name="code">m_storage.updateTrailerDictionary(qMove(trailerDictionary));&#xd; <property name="code">m_storage.updateTrailerDictionary(qMove(trailerDictionary));&#xd;&#xd;
updateDocumentInfo(qMove(updatedInfoDictionary));</property> updateDocumentInfo(qMove(updatedInfoDictionary));</property>
</QObject> </QObject>
</property> </property>