I'm converting a plain, vanilla text file (attached) to a pdf (also attached).  
The problem is that there is too much white space between the lines in the pdf. 
 There are no extra blank lines in the text file - lines are just separated by 
a crlf.  (I'm speaking in particular of lines 11-16, i.e., "POWER WINDOWS" thru 
"BRAKE CONCERN".)  How can I remove the white space between these lines so that 
they're closer together?  Here's the code I'm using:
          string txtfile = @"C:\Temp\00002RX06I00QL_sanitized.txt";
          string outfile = @"C:\Temp\Text.pdf";
          string txtcontent = File.ReadAllText(txtfile);
          Document document = new Document(new iTextSharp.text.Rectangle(72 * 
8.5f, 72 * 17f), 0, 0, 0, 0);
          PdfWriter.GetInstance(document, new FileStream(outfile, 
FileMode.Create));
          document.Open();
          Paragraph par = new Paragraph(txtcontent, 
FontFactory.GetFont(FontFactory.COURIER, 8, iTextSharp.text.Font.NORMAL));
          document.Add(par);
          document.Close();

Thanks!


-----------------
Barry Dysert
[email protected]

  01PNZ030         30000 MILE SERVICE              MI       0.00  01PNZ045      
   45000 MILE SERVICE              MO       0.00
  99PNZ            PONT CAMPAIGNS                  CA       0.00                
                                                
                                                                                
                                                
                                                                                
                                                
                                                                                
                                                
  



    02/24/03                  36864          27150        143        101   W  
51PNZ10          POWER WINDOWS                      
    01/28/03                  35867          26417        143         14   W  
10PNZ06          CHECK ENGINE LIGHT                 
    08/20/02                  30067          21278        143        128   W  
60PNZ            INTERIOR TRIM                      
                                                                     128   W  
51PNZ            BODY ELECTRICAL                    
    04/10/02                  24940          16047        104        162   W  
60PNZ            INTERIOR TRIM                      
                                                                     162   W  
40PNZ            BRAKE CONCERN                      


SALESPERSON NO. 27        KEVIN A TOLES                     S E R V I C E

          X X X X X X X X X X X X X X X X X    01/PONTIAC/GRAND AM/2 DOOR COUPE 
   09/01/00                                64742

           ELI A GREEN                              1842        BLACK/DK PEWTER 
   04/16/01   21                        03/03/05  

           1234 APPLES RD                                                       
                                             126

                                                                                
                                            7231

           WAYTON, NC 12345                                                     
                                           30002

           888-555-1234         888-555-1234                                    
                                               A

           03:19pm     03/03/05    04:54pm       2                              
                                               Y

                                                                                
                                               N

  X                                                                             
                                               Y


      ORIGINAL CUSTOMER ESTIMATE:    TOTAL
                                           
      X-------------------------

  1   W  50PNZ04          CHECK CHARGING SYS                                    
                                                  
                          BATTERY GONG DEAD                                     
                                                 







































   PAGE 1  OF 1    64742                                                        
             


Attachment: Text.pdf
Description: Text.pdf

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to