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
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
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
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
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
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Subject: pdf2ps and acrobat say my PDF has an error

Subject: pdf2ps and acrobat say my PDF has an error

2007-11-06       - By Luis Mineiro

 Back
Hi,

I have this PDF created with OpenOffice 2.3 under Linux with only 2 pages.
I'm adding some overlay content to that PDF, a few numbers here and
there and a single phrase in the middle.
All of this happens in the first page.

Everyhting is working with no Exceptions and I'm getting a PDF that
evince can open and doesn't throw any error.

When I tried to pdf2ps that same PDF ghostscript choked and gave me
some error dump like:
Error: /undefined in --run--
Operand stack:
  --dict:7/16(L)--
Execution stack:
  %interp_exit   .runexec2   --nostringval--   --nostringval--
--nostringval--   2   %stopped_push   --nostringval--
--nostringval--   --nostringval--   false   1   %stopped_push   1889
1   3   %oparray_pop   1888   1   3   %oparray_pop   1872   1   3
%oparray_pop   --nostringval--   --nostringval--   2   1   2
--nostringval--   %for_pos_int_continue   --nostringval--
--nostringval--   --nostringval--   --nostringval--   %array_continue
--nostringval--   false   1   %stopped_push   --nostringval--
%loop_continue   --nostringval--
Dictionary stack:
  --dict:1151/1684(ro)(G)--   --dict:2/20(G)--   --dict:97/200(L)--
--dict:97/200(L)--   --dict:106/127(ro)(G)--   --dict:274/300(ro)(G)--
 --dict:21/25(L)--   --dict:4/6(L)--   --dict:20/20(L)--
--dict:10/13(L)--
Current allocation mode is local
GPL Ghostscript SVN PRE-RELEASE 8.61: Unrecoverable error, exit code 1"

I tried it with different version of ghostscript to see if there was a
problem with my GS version but it happens with any version.

I then tried to open the PDF with Adobe Acrobat 8 (Windows XP box) and
if I try to print the file it also says that the PDF contains errors
and that I should contact the creator (something like that).

What I did after was to debug what could bhe causing the error, so I
tried to pdf2ps with the original PDF from OO.org and it ran OK.
Back to java code, I started removing chunks of code until the GS
error came back. I was able to isolate the error to the following
piece of code:

com.lowagie.text.Font titAcc =
FontFactory.getFont(FontFactory.TIMES_BOLD, 14,
com.lowagie.text.Font.UNDERLINE);
Phrase phrase = new Phrase("TITULO DE " + step + " ACCOES", titAcc);
ColumnText ct = new ColumnText(over);
ct.setSimpleColumn(phrase, 95.3f, 300.0f, 500.0f, 350.0f, 0,
Element.ALIGN_CENTER);
ct.go();

Where step is a method parameter (int) and over is
PdfContentByte over = pdfStamp.getOverContent(1);
and pdfStamp is a PdfStamper

I have a few showTextAligned() calls before that code and the
resulting PDF, without the Phrase/ColumnText is OK with GS and
Acrobat.

Am I doing something wrong?

I need to add some underlined text in a specific position.

Thanks in advance.

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

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