Hi there -
I'm just getting start with development on OSX, and I'm using xcode. I've
created a very very simple java/cocoa app using the basic xcode project
template, and added essentially one button to a cocoa window/form. In the
button handler, I pasted the hello world example code for creating a simple
pdf doc. That works fine.
The problem comes in when I try to process a WMF file. I can open a WMF,
and output HTML without difficulty, however if I try to output a PDF doc,
the PDF DOES GET PROPERLY SAVED, WITH THE GRAPHIC PROPERLY EMBEDDED, however
the program hangs, every time. It's like the UI message loop or thread gets
hung up somehow.
I tried the debugger in xcode, but I couldn't be more lost. I looks like
it's popping me into some machine language trace or something! In fact I
can't even get a breakpoint to work properly. Java/cocoa documentation
seems to be pretty sparse for xcode/osx/mac.
Is anyone out there using itext as part of a java/cocoa app on osx? I'm
running on a PB, OS 10.3.7, with all the latest patches and updates. Xcode
1.5.
Listing:
public class TestPdfController {
public Object myTestPdf; /* IBOutlet */
public void fetch(Object sender) { /* IBAction */
//System.out.println("We Are Here");
// creation of the document with a certain size and certain margins
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
try {
// creation of the different writers
//HtmlWriter.getInstance(document, System.out);
//PdfWriter.getInstance(document, new
FileOutputStream("text.pdf"));
//RtfWriter.getInstance(document, new
FileOutputStream("text.rtf"));
// we add some meta information to the document
document.addAuthor("Bruno Lowagie");
document.addSubject("This is the result of a Test.");
// we open the document for writing
document.open();
Image wmf = Image.getInstance("USA Bear.wmf");
document.add(wmf);
wmf = null;
document.add(new Paragraph("Hello world"));
}
catch(DocumentException de) {
System.err.println(de.getMessage());
}
catch(FileNotFoundException fe) {
System.err.println(fe.getMessage());
}
catch(MalformedURLException urle) {
System.err.println(urle.getMessage());
}
catch(Exception e) {
System.err.println(e.getMessage());
}
document.close();
//System.out.println("We Are at end");
}
}
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions