[poppler] TextAnnotation Orientation
Cory Lorenz
cory at plangrid.com
Wed Jan 30 13:13:24 PST 2013
Hi Everyone,
I am trying to annotate a PDF with text using Poppler, and I can get it to work, but the text is oriented up-down rather than left-right. Looking at the pdfinfo, I see that the sheet is rotated by 270. Short of rotating the source PDF to 0, adding the annotation, and then rotating back, is there a way to set the orientation of the text box? My code is below.
Thanks!
-Cory
QString *annFileName = new QString (srcFileName);
Poppler::Document* doc = Poppler::Document::load(*annFileName);
Poppler::TextAnnotation *it = new Poppler::TextAnnotation(Poppler::TextAnnotation::InPlace);
it->setInplaceText(QString("Bingo Bango Bongo"));
it->setBoundary(QRectF(0.1,0.1,0.05,0.2));
it->setTextFont( QFont( QString("Arial"), 25 ) );
Poppler::Annotation::Style styleT;
styleT.setColor(QColor(0, 255, 0));
it->setStyle(styleT);
pdfPage->addAnnotation(it);
Poppler::PDFConverter *conv = doc->pdfConverter();
conv->setOutputFileName(QString(destFileName));
conv->setPDFOptions(conv->pdfOptions() |
Poppler::PDFConverter::WithChanges);
conv->convert();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20130130/901c3220/attachment.html>
More information about the poppler
mailing list