[poppler] poppler-dump

Albert Astals Cid aacid at kde.org
Wed Mar 12 11:57:54 PDT 2014


El Dimecres, 12 de març de 2014, a les 19:49:44, Marco va escriure:
> 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 -'.

physical_layout should be the same as pdftotext.

Cheers,
  Albert

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



More information about the poppler mailing list