Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
JSP - A mailing list about Java Server Pages specification and reference
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Mixing text and lines

Mixing text and lines

2006-08-10       - By Glen Self

 Back
Reply:     1     2     3     4     5  

I am doing something wrong with mixing boxes and lines with my text.
I keep getting the error "Illegal operation inside a path." from acroreader7.
I am attempting to replicate a form that needs to be emailed to people that has
lines and check boxes intermixed with hard text and text from a database.
The snippet below shows what I am doing.

PdfWriter writer = PdfWriter.getInstance(document,new
FileOutputStream("HelloWorld.pdf"));
         
document.addAuthor("Glen Self");
document.addTitle("SDNA Questionaire");
   
document.open();
         
HeaderFooter footer = new HeaderFooter(new Phrase("Page "),true);
footer.setAlignment(Element.ALIGN_CENTER );
document.setFooter(footer);
         
PdfContentByte cb = addBarCode(iPid, document, writer);
cb.rectangle(20,580,300,70);
cb.stroke();
               
s_affsubdiv_flag = rsProv.getString("affsubdiv_flag");
s_affsubdiv_text = rsProv.getString("affsubdiv");
               
s_affsubdiv_flag = "S";            
if(s_affsubdiv_flag.contentEquals("S")){
       print_box(cb, 158, 520, bfTimes,"Y");                
else{
       print_box(cb, 158, 520, bfTimes,"");                                   }
//The following line works fine here as do the previous calls
print_box(cb, 10, 460, bfTimes,"Y");
cb.moveTo(50,50);
cb.beginText();
cb.setFontAndSize (bfTimesBold, 12);            
            cb.showTextAligned(PdfContentByte.ALIGN_CENTER,"PLEASE RETURN
BY:",450,710,0);
            cb.showTextAligned(PdfContentByte.ALIGN_CENTER,"July 7, 2006",450,700,0
);
cb.endText();
int iMarginMailAddr = 50;
int iMargin = 12;
cb.beginText();
cb.setFontAndSize (bfTimes, 10);            
               
cb.setTextMatrix(iMarginMailAddr, 620);
cb.showText(rsProv.getString("mail_to"));
cb.moveText(0,-10);
cb.newlineShowText(rsProv.getString("coname"));
cb.moveText(0,-10);
cb.showText(rsProv.getString("address1"));
cb.endText();
               
addPhoneNumberstest(rsProv, bfTimesBold, bfTimes, cb, iMargin);
               
cb.beginText();
cb.setFontAndSize (bfTimesBold, 10);            
cb.setTextMatrix(iMargin, 520);
cb.showText("Date Inc.: ");
cb.setFontAndSize (bfTimes, 10);            
cb.showText(rsProv.getString("inc_year"));
cb.setFontAndSize (bfTimesBold, 10);            
cb.moveText(80,0);
cb.showText("Your firm is a:     Sub      Div      Affil of : ");
cb.setFontAndSize (bfTimes, 10);            
cb.showText(s_affsubdiv_text
cb.endText();

cb.beginText();
cb.setTextMatrix(iMargin, 500);
cb.showText("Website:");
cb.moveText(80,0);
cb.showText("Employer ID:");
cb.moveText(-80,-20);
cb.showText("Memberships:");
cb.moveText(0,-20);
cb.endText();

//The following line breaks when used here
print_box(cb, 10, 460, bfTimes,"Y");
......??????????????
 
//Here is the routine to print the box          
private static void print_box(PdfContentByte cb, int xpos, int ypos, BaseFont
bfTimes, String yn) {
    cb.rectangle(xpos-1 (See http://pos-1.ora-code.com),ypos-2 (See http://pos-2.ora-code.com),10,10);
    cb.stroke();
    if(yn.length() > 0){
      cb.beginText();
         cb.setTextMatrix(xpos, ypos);
         cb.setFontAndSize (bfTimes, 10);            
      cb.showText(yn);
      cb.endText();
    }
  }



-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
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
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions

©2008 junlu.com - Jax Systems, LLC, U.S.A.