  | 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
|
|
|
  | | | get total number of lines of a PDF page | get total number of lines of a PDF page 2006-07-28 - By Feng Zhang
Back To whom it may concern:
I got a task in my project that client requests total number of lines in a pdf file, all text, which narrows down to get total number of lines in the last page. I have read through the tutorial, it looks like I might have a shot in the combination of PdfStamper (AddWatermarkPageNumbers) and paragraph object. My tweaked solution is like this.
int fixedTotalLineNumber = 32 ; int i = 0 ; int OriginalSize = PDFfile.pageNumber; while ( PDFfile.pageNumber == OriginalSize) { appendLine(PDFfile) // the line is an empty paragraph; i++ ; } int lineNumbersInThePage = 32 - i ;
Does it look like a feasible solution? Or, is it possible to append to an existing pdf content? I know you can tell me straight from top of your head while I am searching for a solution here.
Thanks in advance!
Sincerely Feng
<div> </div> <div>To whom it may concern:</div> <div> </div> <div> I got a task in my project that client requests total number of lines in a pdf file, all text, which narrows down to get total number of lines in the last page. </div> <div> I have read through the tutorial, it looks like I might have a shot in the combination of PdfStamper (A<font size="2" >ddWatermarkPageNumbers) and paragraph object. </font></div> <div><font size="2"> My tweaked solution is like this.</font></div> <div><font size="2"></font> </div> <div><font size="2">int fixedTotalLineNumber = 32 ;</font></div> <div><font size="2">int i = 0 ;</font> </div> <div>int OriginalSize = PDFfile.pageNumber;</div> <div><font size="2">while ( PDFfile.pageNumber == OriginalSize) {</font>< /div> <div><font size="2"> </font><font size="2"> appendLine (PDFfile) // the line is an empty paragraph;</font></div> <div><font size="2"> i++ ;</font></div> <div><font size="2">}</font></div> <div><font size="2">int lineNumbersInThePage = 32 - i ; </font></div> <div> </div> <div> Does it look like a feasible solution? Or, is it possible to append to an existing pdf content? </div> <div> I know you can tell me straight from top of your  ;head while I am searching for a solution here. </div> <div><br>Thanks in advance!</div> <div> </div> <div>Sincerely</div> <div>Feng</div>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions
|
|
 |