Hi,
This is in continuation with my previous query.
The PDF version being used is 1.4 that is the version of pdf in one.pdf is 1.4 (Acrobat 5.x).
Also another point to be note is the size of one.pdf is 72kB while the size of the regenerated pdf from iText that two.pdf is 71kB.
Why iText is varying the size of the file when it is just regenerating ?
Regards,
Triloke
| Triloke RAJBHANDARY/ITD
GLT/HSDI/[EMAIL PROTECTED]
ITD GLT/HSDI Sent by: [EMAIL PROTECTED] 08/18/2006 08:23 PM
|
|
Hi,
I am using following piece of code to regenerate the pdf.
one.pdf is the pdf that is read.
two.pdf is the pdf that is regenerated using iText.
one.pdf when viewed in Acrobat Reader ver.7.0 is a landscape size of 11.69*8.26
two.pdf when viewed in same Acrobat Reader ver.7.0 is a portrait size of 8.26*11.69
These sizes are seen from the document properties of the Acrobat Reader 7.0
The iText version that I am using is iText 1.4.3.
Why is this happening? As I am just regenerating the pdf should not it generate the replica of it ? I haven't used any rotate in the code. The portion of the code is attached below:
try {
PdfReader reader = new PdfReader("C:\\test\\one.pdf");
int n = reader.getNumberOfPages();
Rectangle psize = reader.getPageSize(1);
float width = psize.width();
System.out.println("one width >>"+width);
float height = psize.height();
System.out.println(" one height >>"+height);
Document document = new Document(psize,0,0,0,0);
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("c:\\test\\two.pdf"));
document.open();
PdfContentByte cb = writer.getDirectContent();
int i = 0;
int p = 0;
System.out.println("There are " + n + " pages in the document.");
while (i < n) {
document.newPage();
p++;
i++;
PdfImportedPage page1 = writer.getImportedPage(reader, i);
cb.addTemplate(page1, 1.0f, 0, 0, 1.0f, 0, 0);
}
document.close();
PdfReader reader2 = new PdfReader("c:\\test\\two.pdf");
Rectangle p2size = reader2.getPageSize(1);
System.out.println("two width >>"+p2size.width());
System.out.println("two height >>"+p2size.height());
Regards,
Triloke
************************************************************
HSBC Software Development (India) Pvt Ltd
HSBC Center Riverside,West Avenue ,
25 B Kalyani Nagar Pune 411 006 INDIA
Telephone: +91 20 26683000
Fax: +91 20 26681030
************************************************************
*******************************************************************
This e-mail is confidential. It may also be legally privileged.
If you are not the addressee you may not copy, forward, disclose
or use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the
sender immediately by return e-mail.
Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability
for any errors or omissions.
*******************************************************************
"SAVE PAPER - THINK BEFORE YOU PRINT!"
******************************************************************
This message originated from the Internet. Its originator may or
may not be who they claim to be and the information contained in
the message and any attachments may or may not be accurate.
******************************************************************-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-----------------------------------------
******************************************************************
This message originated from the Internet. Its originator may or
may not be who they claim to be and the information contained in
the message and any attachments may or may not be accurate.
******************************************************************
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
-----------------------------------------
******************************************************************
This message originated from the Internet. Its originator may or
may not be who they claim to be and the information contained in
the message and any attachments may or may not be accurate.
******************************************************************
************************************************************
HSBC Software Development (India) Pvt Ltd
HSBC Center Riverside,West Avenue ,
25 B Kalyani Nagar Pune 411 006 INDIA
Telephone: +91 20 26683000
Fax: +91 20 26681030
************************************************************
*******************************************************************
This e-mail is confidential. It may also be legally privileged.
If you are not the addressee you may not copy, forward, disclose
or use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the
sender immediately by return e-mail.
Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability
for any errors or omissions.
*******************************************************************
"SAVE PAPER - THINK BEFORE YOU PRINT!"
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
