[poppler] Please Help on PDF Poppler for the Given Code
Nirmit Kansal
nirmit.kansal at igate.com
Wed Dec 5 01:51:56 PST 2012
Hi,
Actually I am working on an application in which I need to display the headings (or say Intermediate nodes ) of a PDF for a given no. of page.
For this I am using PDFViewer 0.6 and Poppler but I am having difficulty in how to access the only headings of a given page of PDF, so that I can directly go to this,
So please help me to solve this as if you can give an example of a scenario which is similar to my problem.
My code for searching a string is given below:
void PdfView::search(const QString &text, const FindFlags &flags)
{
int page = 0,j = 0,k = 0;
const Poppler::Page::SearchDirection searchDirection = (flags & FindBackward) ? Poppler::Page::PreviousResult : Poppler::Page::NextResult;
const Poppler::Page::SearchMode searchMode = (flags & FindCaseSensitively) ? Poppler::Page::CaseSensitive : Poppler::Page::CaseInsensitive;
int page_count = d->m_popplerPages.count();
while(page < document()->numPages() - 1)
{
while(d->m_popplerPages.at(page)->search(text, d->m_findPositionLeft, d->m_findPositionTop, d->m_findPositionRight, d->m_findPositionBottom, searchDirection, searchMode))
{
if(k == 0)
{
k++;
page_no << page;
j++;
}
}
page++;
k = 0;
d->m_findPositionTop = d->m_findPositionBottom = -1;
d->m_findPositionLeft = d->m_findPositionRight = -1;
}
}
Now using these page numbers I got for my text I want to get the headings or topics names for these pages only.
So, please guide me if poppler is having functionality of getting handle to Topic or heading names of PDF Document.
Please help me as soon as possible, I shall be highly grateful to you.
Thanks and Regards,
Nirmit Kansal
Software Engineer
[cid:image001.jpg at 01CDD2FC.42CBB390]
.........................................
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Disclaimer~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Information contained and transmitted by this e-mail is confidential and proprietary to iGATE and its affiliates and is intended for use only by the recipient. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or use of this e-mail is strictly prohibited and you are requested to delete this e-mail immediately and notify the originator or mailadmin at igate.com <mailto:mailadmin at igate.com>. iGATE does not enter into any agreement with any party by e-mail. Any views expressed by an individual do not necessarily reflect the view of iGATE. iGATE is not responsible for the consequences of any actions taken on the basis of information provided, through this email. The contents of an attachment to this e-mail may contain software viruses, which could damage your own computer system. While iGATE has taken every reasonable precaution to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should carry out your own virus checks before opening an attachment. To know more about iGATE please visit www.igate.com <http://www.igate.com>.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20121205/cdcf5bd3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 6335 bytes
Desc: image001.jpg
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20121205/cdcf5bd3/attachment-0001.jpg>
More information about the poppler
mailing list