After much gnashing of teeth, and grumbling. I discovered it was an Acrobat problem. Even though I have the page size set to 8.5 x 11, with the "Shrink oversized pages to paper size" option selected Acrobat messes with the page. Turn that option off and everything works very well.
Thanks. Michael L. Gantz -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Paulo Soares Sent: Wednesday, June 18, 2003 7:38 AM To: Mike Gantz; [EMAIL PROTECTED] Subject: RE: [iText-questions] Problem with in-accurate units of measure. It's a printer or printer driver issue. iText creates an accurate PDF, after that, is out of our hands. Best Regards, Paulo Soares > -----Original Message----- > From: Mike Gantz [SMTP:[EMAIL PROTECTED] > Sent: Tuesday, June 17, 2003 20:51 > To: [EMAIL PROTECTED] > Subject: [iText-questions] Problem with in-accurate units of measure. > > > When I run the following code and print the resulting PDF file (using > Acrobat Reader 5.1) I expect to get a rectangle 4 inches wide by 5 inches > high spaced 1 inch from the bottom left margin. > > Instead I get a rectangle that is about 3.75 inches wide by 4.68 inches > high. Also, the rectangle is spaced about 1.18 inches from the left margin > and 1.31 inches from the bottom margin. What is the reason for this? Is > the PDF format not this accurate? Is this an Acrobat issue? Is it an > itext issue? > > I would appreciate any assistance offered. > > Thanks, > > Michael L. Gantz > > > > import java.io.*; > import com.lowagie.text.*; > import com.lowagie.text.pdf.*; > > public class Test { > > public static float toPoints(double inches) { > return(float) (inches * 72.0); > } > > public static void main(String args[]) { > > try { > FileOutputStream fos; > Document document; > PdfWriter writer; > PdfContentByte cb; > Rectangle pageSize; > > fos = new FileOutputStream("test.pdf"); > pageSize = new Rectangle(toPoints(8.5), toPoints(11.0)); > document = new Document(pageSize); > > writer = PdfWriter.getInstance(document, fos); > > document.open(); > > cb = writer.getDirectContent(); > > cb.rectangle(toPoints(1.0), toPoints(1.0), > toPoints(4.0), toPoints(5.0)); > cb.stroke(); > document.close(); > } catch(Throwable t) { > t.printStackTrace(); > } > } > } > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
