How use itext to change existing pdf pagesize? -


i have pdf, beyond current page, there content not being displayed. want change pagesize of content can displayed. there way itext?

public pdfreader changepdfpagesize(string inpdf,string outpdf,float vertical,float horizontal) {     try      {         pdfreader reader = new pdfreader(inpdf);         pdfstamper stamper = new pdfstamper(reader, new fileoutputstream(outpdf));         (int curpagenum = 1; curpagenum <= reader.getnumberofpages(); ++curpagenum) {             pdfdictionary pagedict = reader.getpagen(curpagenum);             pdfarray mediabox = pagedict.getasarray(pdfname.mediabox);             mediabox.set(0, new pdfnumber(mediabox.getasnumber(0).intvalue()-horizontal));//left add             mediabox.set(1, new pdfnumber(mediabox.getasnumber(1).intvalue()-vertical));//down              mediabox.set(2, new pdfnumber(mediabox.getasnumber(2).intvalue()+horizontal));//right             mediabox.set(3, new pdfnumber(mediabox.getasnumber(3).intvalue()+vertical));//up         }          stamper.close();          return  new pdfreader(outpdf);     } catch (filenotfoundexception e)      {         e.printstacktrace();     } catch (documentexception e)     {         e.printstacktrace();     } catch (ioexception e)      {         e.printstacktrace();     }     return null; } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -