• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Generate PDF from dynamically generated WOComponents...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generate PDF from dynamically generated WOComponents...


  • Subject: Re: Generate PDF from dynamically generated WOComponents...
  • From: shravan kumar <email@hidden>
  • Date: Thu, 30 Apr 2009 10:09:11 -0700 (PDT)

Thanks so much for all your on-time responses.

Could you please let me know whether the suggested tools also do satisfy below need:

Basically, I have few components (as I detailed in my initial email) and each component can in runtime be delivered as one or more pages.

I would like to generate PDF from these components offline _without_ browser interaction on the server-side once the user has confirmed the wizard content.

And most of these components design is dependent on _javascript_ that gets executed once the document is ready. 

Does any of these tools supports the above need as well? Please advise.

Thanks so much,
Shravan Kumar. M
-----------------------------------

--- On Thu, 4/30/09, Jake MacMullin <email@hidden> wrote:

From: Jake MacMullin <email@hidden>
Subject: Re: Generate PDF from dynamically generated WOComponents...
To: "Jean-Francois Veillette" <email@hidden>
Cc: "Hugi Thordarson" <email@hidden>, email@hidden, "shravan kumar" <email@hidden>
Date: Thursday, April 30, 2009, 5:42 AM

An interesting idea (though nowhere near being a reality) is this _javascript_ pdf generation library..

http://jspdf.googlecode.com/svn/trunk/examples/basic.htm

Cheers,

Jake

On Thu, Apr 30, 2009 at 9:01 AM, Jean-Francois Veillette <email@hidden> wrote:
a 4th option would be UJAC:  http://ujac.sf.net
It is similar to xml-fo, but lot simpler and closer to html.  It is also more flexible.  It would be my first choice if only the only caveat is that it is not 'standard', so it will depend on your organisation and on long term plan for what you are doing.

- jfv

Le 09-04-29 à 18:31, Hugi Thordarson a écrit :

A good and swineflufree afternoon to ya'll.
If you already have HTML that you want to render as PDF, The Flying Saucer Project is your new saviour.

1. Go to https://xhtmlrenderer.dev.java.net/ and download a stable binary.
2. Add the three required jars to your project (iText/xml/core-renderer).
3. Use something like the following method (or one of other dozen methods) to render your HTML to PDF:


       /**
        * Uses xhtmlrenderer to generate a PDF-file from XHTML.
        *
        * @param htmlString HTML String to convert to PDF. Valid XHTML only, please.
        * @return Beautifully rendered PDF data.
        */
       public static byte[] convertHTMLToPdf( String htmlString ) {
               try {
                       ByteArrayOutputStream os = new ByteArrayOutputStream();

                       ITextRenderer renderer = new ITextRenderer();
                       renderer.setDocumentFromString( htmlString );
                       renderer.layout();
                       renderer.createPDF( os );

                       os.close();

                       return os.toByteArray();
               }
               catch( Exception e ) {
                       logger.error( "Could not convert HTML to PDF", e );
               }

               return null;
       }

If you want alternatives, I've been through a few hoops with PDF-generation in my days, and this is my opinion on some of them:

- FO processed with FOP: Flexible, but FO XML syntax is an entirely new language to learn, very verbose and an overkill for 99% of use cases. FOP implementation of FO lacked features I wanted, and I've deprecated use of FO within our corporation.
- PD4ML: My previous tool of choice for the simple things. Converts HTML to PDF, but is neither free nor OSS. And Flying Saucer Project does nicer rendering anyway.
- iText, using the java APIs: Very powerful, very flexible, a control freak's dream :-). I use it for mission critical stuff where I need maximum control over presentation and want to generate tiny, beautiful (binarily talking) files. It's a bit like creating documents using the DOM API, only simpler and nicer (thank god).

Cheers,
- Hugi

ps: If you don't know how to get HTML from your rendered component - then to get you started, you can call myPDFToBeComponent.context().response().contentString().








On 29.4.2009, at 18:26, shravan kumar wrote:

Hello Group,

We have an app, where a module is presented to the user in a wizard fashion i.e., this module has several pages and user can navigate from one page to another using the wizard navigation controls and jump to any sections as required.

Once the user has completed one trip to this wizard i.e., if for once user has watched all the screens in the wizard then upon user Finalizing the wizard data we would need to create a pdf with the content in each screen/ page of the wizard automatically and email this pdf to our support team.

We have components in this wizard designed and are functional. Now we need to get the pdf document out of this wizard generated automatically upon user finalizing the wizard data from back end.

User is not suppose to invoke this pdf generation but rather should happen automatically.

Any one please advise me the best way to achieve this and also suggest if we have any tools already available over the internet and I can reuse them here.

Please let me know if I did not present myself correctly.

Thanks in advance,
Shravan Kumar. M
------------------------------------------

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Generate PDF from dynamically generated WOComponents...
      • From: Phillip Hutchings <email@hidden>
  • Prev by Date: Re: WWDC sold out, WOWODC hotel booking for weekend or streaming?
  • Next by Date: Re: MOSXSWebPassword
  • Previous by thread: Re: Generate PDF from dynamically generated WOComponents...
  • Next by thread: Re: Generate PDF from dynamically generated WOComponents...
  • Index(es):
    • Date
    • Thread