I have a little problem with using this Framework and would really appreciate a little help.

Im trying to create a PDF doc based on the contents of a component but run into a error

I have this code:

           PDFPage pdfPage = (PDFPage)pageWithName("PDFPage");
                HTML2PDFConvertor pdfConvertor = new HTML2PDFConvertor();
pdfConvertor.createDocument("A4", HTML2PDFConvertor.PortraitOrientation);
                pdfConvertor.setTopMargin(5);   pdfConvertor.setLeftMargin(5);
                pdfConvertor.setPrintsVerticallyCentered(false);
                pdfPage.setConvertor(pdfConvertor);
        WOComponent demoPage = pageWithName("Demo");
        pdfPage.appendComponent(demoPage);


     WOResponse response = pdfPage.generateResponse();
    NSData htmlAsData = response.content();

        try{
FileOutputStream fileToSaveAs = new FileOutputStream((String) System.getProperties().getProperty("pathToServer")+"0000004.pdf");
    htmlAsData.writeToStream(fileToSaveAs);



              }catch(FileNotFoundException e){

        e.printStackTrace();
        }catch(IOException io){
        io.printStackTrace();
        }


And I get this error with the debugger launching -

java[1100] *** Uncaught exception: <NSInvalidArgumentException> *** - [NSPlaceholderString initWithString:]: nil argument

Anyone point me in the right direction

GIno
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to