<div dir="ltr"><div><div><div><div><div><div>Hi,<br></div>I'm trying to annotate a pdf file, but everytime I annotate a pdf, it get's corrupted (Okular says it cannot open it).<br><br></div>Please point out what am I doing wrong,<br>
</div>here's my code...<br><br><span style="color:rgb(102,102,102)"><span style="background-color:rgb(255,255,255)"><span style="font-family:comic sans ms,sans-serif">TextAnnotation *ta = new TextAnnotation(TextAnnotation::InPlace);<br>
ta->setInplaceText("Inplace");<br>pDoc->page(currentPage)->addAnnotation(ta);<br>Poppler::PDFConverter *conv = pDoc->pdfConverter();<br>conv->setOutputFileName(this->currentFileName());<br>conv->setPDFOptions(conv->pdfOptions() | Poppler::PDFConverter::WithChanges);<br>
conv->convert();</span></span></span><br><br><br></div>I execute this & when I reload the document, it fails to load.<br><br></div><b>If you want specific error msg:</b><br>
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(180,9,9)">"Error: May not be a PDF file (continuing anyway)" </span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(180,9,9)">"Error: Couldn't find trailer dictionary" </span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(180,9,9)">"Error: Invalid XRef entry" </span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(180,9,9)">"Error: Couldn't find trailer dictionary" </span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(180,9,9)">"Error: Catalog object is wrong type (null)" </span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(180,9,9)">"Error: Couldn't find trailer dictionary" </span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(180,9,9)">"Error: Couldn't find trailer dictionary" </span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(180,9,9)">"Error: Catalog object is wrong type (null)" </span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(180,9,9)">"Error: Couldn't read page catalog" </span></p><br></div><br>-Jaydeep<br></div>