I'm using itext-1.4.5.jar with TestEps.java (derived from eps.java in
examples-155) with an EPS file.
I'm getting
"DocumentException: DocumentException: DocumentException:
java.lang.IllegalStateException: Null token encountered; last unknown
identifier was rectstroke at line 24
at com.lowagie.text.pdf.codec.postscript.PAEngine.process
(PAEngine.java:119)"
If I comment out calls to rectstroke -- my EPS has this defined as
rs, but that's not a factor here -- it looks to me like
com.lowagie.text.pdf.codec.postscript.* doesn't support the
rectstroke PostScript operator. Does iText support only a subset of
PS operators? Is there a list?
=-=-=-=-=-=-= TestEps.eps =-=-=-=-=-=-=
import java.io.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
public class TestEps {
public static void main(String[] args) {
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
try {
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("a.pdf"));
document.open();
Image img = Image.getInstance("a.eps");
document.add(img);
document.close();
}
catch (Exception de) {
de.printStackTrace();
}
}
}
=-=-=-=-=-=-= a.eps =-=-=-=-=-=-=
%!PS-Adobe-3.1 EPSF-3.0
%%BoundingBox: 0 0 595 842
%%Title: side1
%%CreationDate: 2006-10-09 17:23:08.588
/h {closepath} def
/c {curveto} def
/f {fill} def
/l {lineto} def
/m {moveto} def
/n {newpath} def
/rc {rectclip} def
/rf {rectfill} def
/rs {rectstroke} def
/w {setlinewidth} def
/sc {setrgbcolor} def
/s {show} def
/S {stroke} def
0.840 -0.840 scale
0 -842 0.840 div translate
1 w
1 setlinejoin
1 setlinecap
1 0 0 sc
468 112 16 8 rs
0 0 1 sc
n
479.625 113.75 m
479.125 113.5 l
479.0 113.5 l
479.0 113.625 l
481.0 115.0 l
S
%%EOF
=-=-=-=-=-=-= stacktrace =-=-=-=-=-=-=
DocumentException: DocumentException: DocumentException:
java.lang.IllegalStateException: Null token encountered; last unknown
identifier was rectstroke at line 24
at com.lowagie.text.pdf.codec.postscript.PAEngine.process
(PAEngine.java:119)
at com.lowagie.text.pdf.codec.postscript.PAEngine.process
(PAEngine.java:138)
at com.lowagie.text.pdf.codec.postscript.PAEngine.process
(PAEngine.java:148)
at com.lowagie.text.pdf.codec.postscript.PAEngine.process
(PAEngine.java:138)
at com.lowagie.text.pdf.codec.postscript.PAParser.parse
(PAParser.java:152)
at com.lowagie.text.pdf.codec.postscript.PAContext.draw
(PAContext.java:147)
at com.lowagie.text.pdf.codec.postscript.MetaDoPS.readAll
(MetaDoPS.java:82)
at com.lowagie.text.ImgPostscript.readPostscript(ImgPostscript.java:
226)
at com.lowagie.text.pdf.PdfWriter.addDirectImageSimple
(PdfWriter.java:966)
at com.lowagie.text.pdf.PdfWriter.addDirectImageSimple
(PdfWriter.java:932)
at com.lowagie.text.pdf.PdfContentByte.addImage(PdfContentByte.java:
1147)
at com.lowagie.text.pdf.PdfContentByte.addImage(PdfContentByte.java:
1125)
at com.lowagie.text.pdf.PdfDocument.add(PdfDocument.java:2106)
at com.lowagie.text.pdf.PdfDocument.add(PdfDocument.java:2021)
at com.lowagie.text.Document.add(Document.java:281)
at TestEps.main(TestEps.java:13)
=-=-=-=-=-=-= build/test script =-=-=-=-=-=-=
#!/bin/sh
javac -cp itext-1.4.5.jar TestEps.java
java -Djava.awt.headless=true -Dcom.apple.backgroundOnly=true -cp
itext-1.4.5.jar:. TestEps
=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
Hadleigh Fax: +44 (0)1702 556855
Essex. SS7 2BT Email: [EMAIL PROTECTED]
England (MIME welcome)
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions