From: Sébastien Noel Subject: fix build against qpdf 12 --- a/filter/pdf.cxx +++ b/filter/pdf.cxx @@ -21,6 +21,8 @@ #include #include #include +#define POINTERHOLDER_TRANSITION 3 +#include #include #include #include --- a/filter/pdftopdf/qpdf_xobject.cc +++ b/filter/pdftopdf/qpdf_xobject.cc @@ -1,5 +1,7 @@ #include "qpdf_xobject.h" //#include +#define POINTERHOLDER_TRANSITION 3 +#include #include #include #include --- a/filter/rastertopdf.cpp +++ b/filter/rastertopdf.cpp @@ -39,6 +39,8 @@ #include // ntohl #include +#define POINTERHOLDER_TRANSITION 3 +#include #include #include #include @@ -481,7 +483,7 @@ QPDFObjectHandle embedIccProfile(QPDF &p cmsSaveProfileToMem(colorProfile, buff, &profile_size); // Write ICC profile buffer into PDF - ph = new Buffer(buff, profile_size); + ph = (PointerHolder) new Buffer(buff, profile_size); iccstream = QPDFObjectHandle::newStream(&pdf, ph); iccstream.replaceDict(QPDFObjectHandle::newDictionary(streamdict)); --- a/filter/pdftopdf/qpdf_pdftopdf_processor.cc +++ b/filter/pdftopdf/qpdf_pdftopdf_processor.cc @@ -83,10 +83,10 @@ page.getKey("/Resources").replaceKey("/XObject",QPDFObjectHandle::newDictionary(xobjs)); content.append("Q\n"); page.getKey("/Contents").replaceStreamData(content,QPDFObjectHandle::newNull(),QPDFObjectHandle::newNull()); - page.replaceOrRemoveKey("/Rotate",makeRotate(rotation)); + page.replaceKey("/Rotate",makeRotate(rotation)); } else { Rotation rot=getRotate(page)+rotation; - page.replaceOrRemoveKey("/Rotate",makeRotate(rot)); + page.replaceKey("/Rotate",makeRotate(rot)); } page=QPDFObjectHandle(); // i.e. uninitialized return ret; @@ -181,9 +181,9 @@ page.assertInitialized(); Rotation save_rotate = getRotate(page); if(orientation==ROT_0||orientation==ROT_180) - page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_90)); + page.replaceKey("/Rotate",makeRotate(ROT_90)); else - page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_0)); + page.replaceKey("/Rotate",makeRotate(ROT_0)); PageRect currpage= getBoxAsRect(getTrimBox(page)); double width = currpage.right-currpage.left; @@ -242,7 +242,7 @@ //Cropping. // TODO: Borders are covered by the image. buffer space? page.replaceKey("/TrimBox",makeBox(currpage.left,currpage.bottom,currpage.right,currpage.top)); - page.replaceOrRemoveKey("/Rotate",makeRotate(save_rotate)); + page.replaceKey("/Rotate",makeRotate(save_rotate)); return getRotate(page); } @@ -251,14 +251,14 @@ page.assertInitialized(); Rotation save_rotate = getRotate(page); if(orientation==ROT_0||orientation==ROT_180) - page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_90)); + page.replaceKey("/Rotate",makeRotate(ROT_90)); else - page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_0)); + page.replaceKey("/Rotate",makeRotate(ROT_0)); PageRect currpage= getBoxAsRect(getTrimBox(page)); double width = currpage.right-currpage.left; double height = currpage.top-currpage.bottom; - page.replaceOrRemoveKey("/Rotate",makeRotate(save_rotate)); + page.replaceKey("/Rotate",makeRotate(save_rotate)); if(width>height) return true; return false; @@ -662,7 +662,7 @@ // TODO? other rotation direction, e.g. if (src_rot==ROT_0)&&(param.orientation==ROT_270) ... etc. // rotation=ROT_270; - page.replaceOrRemoveKey("/Rotate",makeRotate(src_rot+rotation)); + page.replaceKey("/Rotate",makeRotate(src_rot+rotation)); } } }