|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
RtfShape line widthHi.
I'm trying to use RtfShape to draw lines. Well. I'm SUCCEEDING in using RtfShape to draw lines, but one thing I want to do is set the width of the line produced. I can't see a way to do this in the API - is there something I'm missing? Michael ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list iText-questions@... https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar |
||||||||
|
|
|
||||||||
|
|
Cell HeightHi all, I need be able to find the height of a cell that was just created with the data having been placed into the cell. The thing is, I do not know how much data is going into the cell as the data is pulled from a database. It could be a few words long or 500 words long. I have gone through the iText Docs that I downloaded with all the classes and tried to figure out how I can do it, but I find nothing of value, or I am missing it altogether. My book has not yet arrived and am expecting it maybe next week, if I am lucky. Chapters tends to be slow to my area for some reason.. Has anyone tried doing this?? Example code I am using: outLine = quoteValidity; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 10)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable03.addCell(cell); Thanks in advance. Glen Hamel Lead Programmer / Technician Auric Networks Canada, Inc. 570 Orwell Street, Unit 1 Mississauga, Ontario L5A 3V7 Phone 905.361.7621 Fax 905.274.3912 http://www.auricnet.ca |
||||||||
|
|
Re: Cell HeightPdfPTable.getRowHeight(). You must set the total width first.
Paulo ----- Original Message ----- From: <glen.hamel@...> To: "Post all your questions about iText here" <itext-questions@...> Sent: Tuesday, May 13, 2008 7:17 PM Subject: [iText-questions] Cell Height > Hi all, > > I need be able to find the height of a cell that was just created with the > data having been placed into the cell. > The thing is, I do not know how much data is going into the cell as the > data is pulled from a database. > It could be a few words long or 500 words long. > I have gone through the iText Docs that I downloaded with all the classes > and tried to figure out how I can do it, but I find nothing of value, or I > am missing it altogether. > My book has not yet arrived and am expecting it maybe next week, if I am > lucky. Chapters tends to be slow to my area for some reason.. > Has anyone tried doing this?? > > Example code I am using: > outLine = quoteValidity; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > > Thanks in advance. > > Glen Hamel > Lead Programmer / Technician > Auric Networks Canada, Inc. > 570 Orwell Street, Unit 1 > Mississauga, Ontario > L5A 3V7 > > Phone 905.361.7621 > Fax 905.274.3912 > http://www.auricnet.ca ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list iText-questions@... https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar |
||||||||
|
|
Re: Cell HeightHi Paulo, I tried that and in my Java Debug Console I get an answer of 0.0 for the height. Here is the complete code I am using along with the addition of what you gave me: float widths[] = {4.0f, 2.0f}; houtTable = new PdfPTable(widths); houtTable.setWidthPercentage(100); inTable01 = new PdfPTable(1); inTable01.setWidthPercentage(100); img = Image.getInstance("C:\\RBGApp\\RBGlogo.jpg"); cell = new PdfPCell(img); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable01.addCell(cell); outLine = companyAdd + ", " + companyCity + ", " + companyProv + ", " + companyPostal; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 8)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable01.addCell(cell); outLine = "Telephone: " + companyPhone + " / Fax: " + companyFax + " / " + companyWeb; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 8)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable01.addCell(cell); cell = new PdfPCell(inTable01); cell.setBorder(Rectangle.BOX); cell.setHorizontalAlignment(Element.ALIGN_LEFT); houtTable.addCell(cell); // ----------------- inTable02 = new PdfPTable(1); inTable02.setWidthPercentage(100); outLine = " "; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 8)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable02.addCell(cell); outLine = " "; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 8)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable02.addCell(cell); outLine = " "; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 8)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable02.addCell(cell); outLine = "Quotation"; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLD)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable02.addCell(cell); outLine = " "; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 8)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable02.addCell(cell); // ----------------- inTable03 = new PdfPTable(2); inTable03.setWidthPercentage(100); outLine = "Date: "; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 10)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable03.addCell(cell); outLine = quoteDate; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 10)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable03.addCell(cell); outLine = "Estimate #: "; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 10)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable03.addCell(cell); outLine = quoteNum; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 10)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable03.addCell(cell); outLine = "Terms: "; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 10)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable03.addCell(cell); outLine = quoteTerms; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 10)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable03.addCell(cell); outLine = "Validity: "; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 10)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable03.addCell(cell); outLine = quoteValidity; outPara = new Paragraph(outLine, FontFactory.getFont(FontFactory.HELVETICA, 10)); cell = new PdfPCell(new Paragraph(outPara)); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable03.addCell(cell); cell = new PdfPCell(inTable03); cell.setBorder(Rectangle.NO_BORDER); cell.setHorizontalAlignment(Element.ALIGN_LEFT); inTable02.addCell(cell); cell = new PdfPCell(inTable02); cell.setBorder(Rectangle.BOX); cell.setHorizontalAlignment(Element.ALIGN_LEFT); houtTable.addCell(cell); print("Height = " + houtTable.getRowHeight(0)); <====== This here reports 0.0 in the console. Glen Hamel Lead Programmer / Technician Auric Networks Canada, Inc. 570 Orwell Street, Unit 1 Mississauga, Ontario L5A 3V7 Phone 905.361.7621 Fax 905.274.3912
PdfPTable.getRowHeight(). You must set the total width first. Paulo ----- Original Message ----- From: <glen.hamel@...> To: "Post all your questions about iText here" <itext-questions@...> Sent: Tuesday, May 13, 2008 7:17 PM Subject: [iText-questions] Cell Height > Hi all, > > I need be able to find the height of a cell that was just created with the > data having been placed into the cell. > The thing is, I do not know how much data is going into the cell as the > data is pulled from a database. > It could be a few words long or 500 words long. > I have gone through the iText Docs that I downloaded with all the classes > and tried to figure out how I can do it, but I find nothing of value, or I > am missing it altogether. > My book has not yet arrived and am expecting it maybe next week, if I am > lucky. Chapters tends to be slow to my area for some reason.. > Has anyone tried doing this?? > > Example code I am using: > outLine = quoteValidity; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > > Thanks in advance. > > Glen Hamel > Lead Programmer / Technician > Auric Networks Canada, Inc. > 570 Orwell Street, Unit 1 > Mississauga, Ontario > L5A 3V7 > > Phone 905.361.7621 > Fax 905.274.3912 > http://www.auricnet.ca ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list iText-questions@... https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list iText-questions@... https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar |
||||||||
|
|
Re: Cell HeightYou need to call PdfPTable.setTotalWidth().
Paulo ----- Original Message ----- From: <glen.hamel@...> To: "Post all your questions about iText here" <itext-questions@...> Sent: Tuesday, May 13, 2008 8:00 PM Subject: Re: [iText-questions] Cell Height > Hi Paulo, > > I tried that and in my Java Debug Console I get an answer of 0.0 for the > height. Here is the complete code I am using along with the addition of > what you gave me: > > float widths[] = {4.0f, 2.0f}; > houtTable = new PdfPTable(widths); > houtTable.setWidthPercentage(100); > inTable01 = new PdfPTable(1); > inTable01.setWidthPercentage(100); > img = Image.getInstance("C:\\RBGApp\\RBGlogo.jpg"); > cell = new PdfPCell(img); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable01.addCell(cell); > outLine = companyAdd + ", " + companyCity + ", " + > companyProv + ", " + companyPostal; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable01.addCell(cell); > outLine = "Telephone: " + companyPhone + " / Fax: " + > companyFax + " / " + companyWeb; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable01.addCell(cell); > cell = new PdfPCell(inTable01); > cell.setBorder(Rectangle.BOX); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > houtTable.addCell(cell); > // ----------------- > inTable02 = new PdfPTable(1); > inTable02.setWidthPercentage(100); > outLine = " "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > outLine = " "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > outLine = " "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > outLine = "Quotation"; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLD)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > outLine = " "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > // ----------------- > inTable03 = new PdfPTable(2); > inTable03.setWidthPercentage(100); > outLine = "Date: "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = quoteDate; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = "Estimate #: "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = quoteNum; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = "Terms: "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = quoteTerms; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = "Validity: "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = quoteValidity; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > cell = new PdfPCell(inTable03); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > cell = new PdfPCell(inTable02); > cell.setBorder(Rectangle.BOX); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > houtTable.addCell(cell); > print("Height = " + houtTable.getRowHeight(0)); <====== This here > reports 0.0 in the console. > > Glen Hamel > Lead Programmer / Technician > Auric Networks Canada, Inc. > 570 Orwell Street, Unit 1 > Mississauga, Ontario > L5A 3V7 > > Phone 905.361.7621 > Fax 905.274.3912 > http://www.auricnet.ca > > > > From: > "Paulo Soares" <psoares@...> > To: > "Post all your questions about iText here" > <itext-questions@...> > Date: > 05/13/2008 02:48 PM > Subject: > Re: [iText-questions] Cell Height > > > > PdfPTable.getRowHeight(). You must set the total width first. > > Paulo > > ----- Original Message ----- > From: <glen.hamel@...> > To: "Post all your questions about iText here" > <itext-questions@...> > Sent: Tuesday, May 13, 2008 7:17 PM > Subject: [iText-questions] Cell Height > > >> Hi all, >> >> I need be able to find the height of a cell that was just created with > the >> data having been placed into the cell. >> The thing is, I do not know how much data is going into the cell as the >> data is pulled from a database. >> It could be a few words long or 500 words long. >> I have gone through the iText Docs that I downloaded with all the > classes >> and tried to figure out how I can do it, but I find nothing of value, or > I >> am missing it altogether. >> My book has not yet arrived and am expecting it maybe next week, if I am >> lucky. Chapters tends to be slow to my area for some reason.. >> Has anyone tried doing this?? >> >> Example code I am using: >> outLine = quoteValidity; >> outPara = new Paragraph(outLine, >> FontFactory.getFont(FontFactory.HELVETICA, 10)); >> cell = new PdfPCell(new Paragraph(outPara)); >> cell.setBorder(Rectangle.NO_BORDER); >> cell.setHorizontalAlignment(Element.ALIGN_LEFT); >> inTable03.addCell(cell); >> >> Thanks in advance. >> >> Glen Hamel >> Lead Programmer / Technician >> Auric Networks Canada, Inc. >> 570 Orwell Street, Unit 1 >> Mississauga, Ontario >> L5A 3V7 >> >> Phone 905.361.7621 >> Fax 905.274.3912 >> http://www.auricnet.ca ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list iText-questions@... https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar |
||||||||
|
|
Re: Cell HeightThanks Paulo, I has assumed that setWidthPercentage would be the same as setTotalWidth.. Once I added the total width, I got it working.. Glen Hamel Lead Programmer / Technician Auric Networks Canada, Inc. 570 Orwell Street, Unit 1 Mississauga, Ontario L5A 3V7 Phone 905.361.7621 Fax 905.274.3912
You need to call PdfPTable.setTotalWidth(). Paulo ----- Original Message ----- From: <glen.hamel@...> To: "Post all your questions about iText here" <itext-questions@...> Sent: Tuesday, May 13, 2008 8:00 PM Subject: Re: [iText-questions] Cell Height > Hi Paulo, > > I tried that and in my Java Debug Console I get an answer of 0.0 for the > height. Here is the complete code I am using along with the addition of > what you gave me: > > float widths[] = {4.0f, 2.0f}; > houtTable = new PdfPTable(widths); > houtTable.setWidthPercentage(100); > inTable01 = new PdfPTable(1); > inTable01.setWidthPercentage(100); > img = Image.getInstance("C:\\RBGApp\\RBGlogo.jpg"); > cell = new PdfPCell(img); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable01.addCell(cell); > outLine = companyAdd + ", " + companyCity + ", " + > companyProv + ", " + companyPostal; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable01.addCell(cell); > outLine = "Telephone: " + companyPhone + " / Fax: " + > companyFax + " / " + companyWeb; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable01.addCell(cell); > cell = new PdfPCell(inTable01); > cell.setBorder(Rectangle.BOX); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > houtTable.addCell(cell); > // ----------------- > inTable02 = new PdfPTable(1); > inTable02.setWidthPercentage(100); > outLine = " "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > outLine = " "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > outLine = " "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > outLine = "Quotation"; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLD)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > outLine = " "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 8)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > // ----------------- > inTable03 = new PdfPTable(2); > inTable03.setWidthPercentage(100); > outLine = "Date: "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = quoteDate; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = "Estimate #: "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = quoteNum; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = "Terms: "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = quoteTerms; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = "Validity: "; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > outLine = quoteValidity; > outPara = new Paragraph(outLine, > FontFactory.getFont(FontFactory.HELVETICA, 10)); > cell = new PdfPCell(new Paragraph(outPara)); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable03.addCell(cell); > cell = new PdfPCell(inTable03); > cell.setBorder(Rectangle.NO_BORDER); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > inTable02.addCell(cell); > cell = new PdfPCell(inTable02); > cell.setBorder(Rectangle.BOX); > cell.setHorizontalAlignment(Element.ALIGN_LEFT); > houtTable.addCell(cell); > print("Height = " + houtTable.getRowHeight(0)); <====== This here > reports 0.0 in the console. > > Glen Hamel > Lead Programmer / Technician > Auric Networks Canada, Inc. > 570 Orwell Street, Unit 1 > Mississauga, Ontario > L5A 3V7 > > Phone 905.361.7621 > Fax 905.274.3912 > http://www.auricnet.ca > > > > From: > "Paulo Soares" <psoares@...> > To: > "Post all your questions about iText here" > <itext-questions@...> > Date: > 05/13/2008 02:48 PM > Subject: > Re: [iText-questions] Cell Height > > > > PdfPTable.getRowHeight(). You must set the total width first. > > Paulo > > ----- Original Message ----- > From: <glen.hamel@...> > To: "Post all your questions about iText here" > <itext-questions@...> > Sent: Tuesday, May 13, 2008 7:17 PM > Subject: [iText-questions] Cell Height > > >> Hi all, >> >> I need be able to find the height of a cell that was just created with > the >> data having been placed into the cell. >> The thing is, I do not know how much data is going into the cell as the >> data is pulled from a database. >> It could be a few words long or 500 words long. >> I have gone through the iText Docs that I downloaded with all the > classes >> and tried to figure out how I can do it, but I find nothing of value, or > I >> am missing it altogether. >> My book has not yet arrived and am expecting it maybe next week, if I am >> lucky. Chapters tends to be slow to my area for some reason.. >> Has anyone tried doing this?? >> >> Example code I am using: >> outLine = quoteValidity; >> outPara = new Paragraph(outLine, >> FontFactory.getFont(FontFactory.HELVETICA, 10)); >> cell = new PdfPCell(new Paragraph(outPara)); >> cell.setBorder(Rectangle.NO_BORDER); >> cell.setHorizontalAlignment(Element.ALIGN_LEFT); >> inTable03.addCell(cell); >> >> Thanks in advance. >> >> Glen Hamel >> Lead Programmer / Technician >> Auric Networks Canada, Inc. >> 570 Orwell Street, Unit 1 >> Mississauga, Ontario >> L5A 3V7 >> >> Phone 905.361.7621 >> Fax 905.274.3912 >> http://www.auricnet.ca ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list iText-questions@... https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list iText-questions@... https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar |
||||||||
|
|
Re: RtfShape line width2008/5/13 Howard Shank <hgshank@...>:
> Hi Michael, > > RtfShapes are controlled by properties. Properties are added using the setProperty() method of the shape. The "lineWidth" property uses a measurement unit of EMU. > > shape.setProperty(new RtfShapeProperty("lineWidth", 9525)); // 9525 EMU = 0.75pt > > You will need the RTF Specification to work with some of the properties. Here is an excerpt of the EMU description from the RTF specification document. > "Distances are expressed in EMU units. There are > 12,700 EMU units in a point hence 914,400 in an inch and 360,000 cm-1." Thanks! The bit I was missing was realising that there were properties available other than those defined as constants on RtfShapeProperty. Michael ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list iText-questions@... https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar |
| Free Forum Powered by Nabble | Forum Help |