mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow building against poppler >= 0.20
This commit is contained in:
parent
8227581a2c
commit
e054082d9f
@ -191,6 +191,9 @@ else:
|
||||
lh = os.path.join(poppler_inc_dirs[0], 'Link.h')
|
||||
if 'class AnnotLink' not in open(lh, 'rb').read():
|
||||
poppler_cflags.append('-DPOPPLER_OLD_LINK_TYPE')
|
||||
ph = os.path.join(poppler_inc_dirs[0], 'Page.h')
|
||||
if 'getLinks(Catalog' in open(ph, 'rb').read():
|
||||
poppler_cflags.append('-DPOPPLER_PRE_20')
|
||||
|
||||
magick_error = None
|
||||
if not magick_inc_dirs or not os.path.exists(os.path.join(magick_inc_dirs[0],
|
||||
|
@ -647,7 +647,12 @@ void XMLOutputDev::process_link(AnnotLink* link){
|
||||
|
||||
|
||||
void XMLOutputDev::endPage() {
|
||||
#ifdef POPPLER_PRE_20
|
||||
Links *slinks = catalog->getPage(current_page->number())->getLinks(catalog);
|
||||
#else
|
||||
Links *slinks = catalog->getPage(current_page->number())->getLinks();
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < slinks->getNumLinks(); i++)
|
||||
{
|
||||
this->process_link(slinks->getLink(i));
|
||||
@ -878,7 +883,11 @@ vector<char>* Reflow::render_first_page(bool use_crop_box, double x_res,
|
||||
throw ReflowException("Failed to allocate SplashOutputDev");
|
||||
}
|
||||
try {
|
||||
#ifdef POPPLER_PRE_20
|
||||
out->startDoc(doc->getXRef());
|
||||
#else
|
||||
out->startDoc(doc);
|
||||
#endif
|
||||
out->startPage(1, NULL);
|
||||
|
||||
double pg_w, pg_h;
|
||||
|
Loading…
x
Reference in New Issue
Block a user