[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-poppler
Subject:    [poppler] poppler-dump
From:       Marco <ctxspi () gmail ! com>
Date:       2014-03-12 18:49:44
Message-ID: CAAVAo4NWUg8tgnRa=WwbXm9Bg+0yYQc30MrKBtTD6N_cHc6GxQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi to all

I am new user to poppler and I have a short question.

In my small program I use these lines:

for (int i = 0; i < pages; ++i) {
    cout << "Page " << (i + 1) << "/" << pages << ":" << endl;
    auto_ptr<poppler::page> p(doc->create_page(i));
    poppler::byte_array text_ba = p.get()->text(p->page_rect(),
poppler::page::raw_order_layout).to_utf8();
    text_ba.push_back(0); // Add a NULL terminator for the C char *
    string text( text_ba.begin(), text_ba.end() );
    cout << text << endl;
    }

to print text of file pdf, but using 'raw_order_layout' or
'physical_layout' the output is different if I use the command 'pdftotext
filename.pdf -'.


How I can show text (but written in a pointer of char) as command
'pdftotext filename.pdf -' ?

Thank

[Attachment #5 (text/html)]

<div dir="ltr"><div><div><div>Hi to all<br><br></div><div>I am new user to poppler \
and I have a short question.<br><br></div><div>In my small program I use these \
lines:<br><br>for (int i = 0; i &lt; pages; ++i) {<br>    cout &lt;&lt; &quot;Page \
&quot; &lt;&lt; (i + 1) &lt;&lt; &quot;/&quot; &lt;&lt; pages &lt;&lt; &quot;:&quot; \
&lt;&lt; endl;<br>  auto_ptr&lt;poppler::page&gt; p(doc-&gt;create_page(i));<br>    \
poppler::byte_array text_ba = p.get()-&gt;text(p-&gt;page_rect(), \
poppler::page::raw_order_layout).to_utf8();<br>    text_ba.push_back(0); // Add a \
NULL terminator for the C char *<br>  string text( text_ba.begin(), text_ba.end() \
);<br>    cout &lt;&lt; text &lt;&lt; endl;<br>    }<br><br></div><div>to print text \
of file pdf, but using &#39;raw_order_layout&#39; or &#39;physical_layout&#39; the \
output is different if I use the command &#39;pdftotext filename.pdf -&#39;.<br> \
<br></div><div><br></div>How I can show text (but written in a pointer of char) as \
command &#39;pdftotext filename.pdf -&#39; \
?<br><br></div><div>Thank<br></div><div><br></div><div><br></div><br> </div></div>



_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic