• 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: PDF generator/converter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDF generator/converter


  • Subject: Re: PDF generator/converter
  • From: Kieran Kelleher <email@hidden>
  • Date: Tue, 6 Jan 2009 06:54:53 -0500

Look at the WOComponent API ......

you can call generateResponse() to get a WOResponse, and then call contentString() on the WOResponse to get the HTML.

The result may have relative URLs in which case you may have to grab the context (WOComponent.context()) and tell it to generate full URLs .... WOContext._generateCompleteURLs.

BTW, it is very beneficial to really study the javadoc API for WOComponent, WOResponse, WORequest, WOMessage, WOContext ..... there is a lot of goodies in there ... and also some useful private methods that are worth looking at. Also check out Project WOnder's subclasses of some of these for more educational benefits ;-)

HTH, Kieran


On Jan 4, 2009, at 10:22 AM, Jeff Schmitz wrote:

I downloaded the example flying saucer stuff and got it to run, but I'm having trouble figuring out how to wrap this up in a component. Since I am generating a WOComponent that I want to transform to a pdf, I'm unsure how to send that finished component (i.e. html file) to the pdf renderer for further processing. Do I need to somehow write my WOComponent to a file where the renderer can see it? Or is there a way to divert it to the renderer directly? i.e. How can I get a serialized version of a WOComponent for further processing instead of just sending it back to the user? Or am I off on the wrong path somehow?

Thanks,
Jeff
On Dec 11, 2008, at 3:57 AM, John Corrigan wrote:

On 10/12/2008, at 1:31 AM, Sherry Tirko wrote:

Hi All,

I'm wondering if anyone knows if there is a pdf generator out there for WO sites or even a converter for WO Components. I'd like to take a form and make a pdf version for printing.

Thanks,
Sherry


Another option may be "The Flying Saucer Project" - An XML/XHTML/ CSS 2.1 Renderer, 100% Java, open-source (LGPL).
http://xhtmlrenderer.dev.java.net/


This seems a little less known but I've had good success with it (no affiliation). Converts any XHTML + CSS 2.1 compliant input to other formats, usually PDF but apparently can do Swing no less. Passes ACID 2 and has some CSS 3 support. It uses iText internally for PDF output.

I'm using the latest pre-release without issue (R8pre2 as of Jan 08). Make sure the input validates as XHTML (for the most part, it's not as strict as http://validator.w3.org/).

WebStart demo app:
https://xhtmlrenderer.dev.java.net/r7/demos.html

Fonts:
It needs to be told about custom fonts (ie. those not available in the JRE).


Example usage (with fonts):
As a starting point a small example project in plain Java is attached (see readme).



Sláinte John


<Example_FlyingSaucerXHTMLRenderer.tgz> _______________________________________________ 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
References: 
 >Re: PDF generator/converter (From: Jeff Schmitz <email@hidden>)

  • Prev by Date: D2W: Rules for the sub components of the EditRelationship page
  • Next by Date: Re: Not finding binding with "$^" notation
  • Previous by thread: Re: PDF generator/converter
  • Next by thread: $parent.method binding error in eclipse
  • Index(es):
    • Date
    • Thread