mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Text annotations graphics
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
QT += gui
|
||||
QT += gui widgets
|
||||
|
||||
CONFIG += c++11 console
|
||||
CONFIG -= app_bundle
|
||||
|
@ -15,12 +15,12 @@
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with PDFForQt. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QApplication>
|
||||
|
||||
#include "pdfexamplesgenerator.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
QApplication a(argc, argv);
|
||||
PDFExamplesGenerator::generateAnnotationsExample();
|
||||
}
|
||||
|
@ -160,36 +160,42 @@ void PDFExamplesGenerator::generateAnnotationsExample()
|
||||
pdf::PDFObjectReference annotation = builder.createAnnotationSquare(page5, QRectF(50, 50, 50, 50), 3.0, Qt::green, Qt::red, "Title1", "Subject1", "Contents - green filling, red boundary");
|
||||
builder.setAnnotationBorderStyle(annotation, pdf::PDFAnnotationBorder::Style::Solid, 2.718);
|
||||
builder.setAnnotationColor(annotation, Qt::black);
|
||||
builder.updateAnnotationAppearanceStreams(annotation);
|
||||
}
|
||||
|
||||
{
|
||||
pdf::PDFObjectReference annotation = builder.createAnnotationSquare(page5, QRectF(50, 150, 50, 50), 3.0, Qt::green, Qt::red, "Title1", "Subject1", "Contents - green filling, red boundary");
|
||||
builder.setAnnotationBorderStyle(annotation, pdf::PDFAnnotationBorder::Style::Underline, 2.718);
|
||||
builder.setAnnotationColor(annotation, Qt::black);
|
||||
builder.updateAnnotationAppearanceStreams(annotation);
|
||||
}
|
||||
|
||||
{
|
||||
pdf::PDFObjectReference annotation = builder.createAnnotationSquare(page5, QRectF(50, 250, 50, 50), 3.0, Qt::green, Qt::red, "Title1", "Subject1", "Contents - green filling, red boundary");
|
||||
builder.setAnnotationBorderStyle(annotation, pdf::PDFAnnotationBorder::Style::Inset, 2.718);
|
||||
builder.setAnnotationColor(annotation, Qt::black);
|
||||
builder.updateAnnotationAppearanceStreams(annotation);
|
||||
}
|
||||
|
||||
{
|
||||
pdf::PDFObjectReference annotation = builder.createAnnotationSquare(page5, QRectF(150, 50, 50, 50), 3.0, Qt::green, Qt::red, "Title1", "Subject1", "Contents - green filling, red boundary");
|
||||
builder.setAnnotationBorderStyle(annotation, pdf::PDFAnnotationBorder::Style::Beveled, 2.718);
|
||||
builder.setAnnotationColor(annotation, Qt::black);
|
||||
builder.updateAnnotationAppearanceStreams(annotation);
|
||||
}
|
||||
|
||||
{
|
||||
pdf::PDFObjectReference annotation = builder.createAnnotationSquare(page5, QRectF(150, 150, 50, 50), 3.0, Qt::green, Qt::red, "Title1", "Subject1", "Contents - green filling, red boundary");
|
||||
builder.setAnnotationBorderStyle(annotation, pdf::PDFAnnotationBorder::Style::Dashed, 2.718);
|
||||
builder.setAnnotationColor(annotation, Qt::black);
|
||||
builder.updateAnnotationAppearanceStreams(annotation);
|
||||
}
|
||||
|
||||
{
|
||||
pdf::PDFObjectReference annotation = builder.createAnnotationSquare(page5, QRectF(150, 250, 50, 50), 3.0, Qt::green, Qt::red, "Title1", "Subject1", "Contents - green filling, red boundary");
|
||||
builder.setAnnotationBorder(annotation, 5.0, 3.0, 2.0);
|
||||
builder.setAnnotationColor(annotation, Qt::black);
|
||||
builder.updateAnnotationAppearanceStreams(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user