Raymond
That is just to set the object of interest into the component that you want to
download.
So in the MyPDFPage component.
MyPDFPage.java
private MyClass _myObject;
public void setMyObject(MyClass myObject) {
_myObject = myObject;
}
public MyClass myObject() {
return _myObject;
}
MyPDFPage.html
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><wo:str value="$myObject.name" /></title>
<wo:ERXStyleSheet filename = "css/style-print.css" media = "print" />
</head>
<body>
<div class="contentArea" >
<wo:str value = "$myObject.name" />
</div>
</body>
On Nov 17, 2011, at 5:59 AM, Raymond NANEON wrote:
> Hi Paul,
>
> thanks a lot for your quick answer but what is the method myObject() ?
> Envoyé depuis iCloud
>
> Le 17 nov 2011 à 02:32, Paul Yu <[email protected]> a écrit :
>
>> Raymond
>>
>> Here's the more complete example.
>>
>>
>> MyComponent.java
>>
>> public WOActionResults downloadAsPDF() {
>>
>> NSMutableDictionary<String, Object> configuration = new
>> NSMutableDictionary<String, Object>();
>> WOContext context = (WOContext) context().clone();
>>
>> MyPDFPage pdfPage = (MyPDFPage)
>> WOApplication.application().pageWithName(MyPDFPage.class.getName(), context);
>> pdfPage.setMyObject(myObject());
>>
>> String baseFileName = someString();
>> String filename = pdfDocumentPrefix() + baseFileName + ".pdf";
>> configuration.takeValueForKey(filename, "filename");
>>
>> WOResponse pdfReport = ERPDFUtilities.pageAsPdf(pdfPage,
>> configuration).generateResponse();
>>
>> return pdfReport;
>> }
>>
>> MyComponent.html
>> <!-- Using inline binding -->
>> <wo:linkaction="$downloadAsPDF"class="downloadPDF"alt="Download
>> PDF"title="Download in PDF format"target="_blank">Download</wo:link>
>>
>> Paul
>>
>> On Nov 17, 2011, at 2:51 AM, Raymond NANEON wrote:
>>
>>> Hi Paul,
>>>
>>> I followed 60 secondes tutorial from wocommunity youtube channel about
>>> ERPDFGeneration and I didn't see this method. So it is used for japser
>>> report or ERPDFWrapper.
>>>
>>> Thanks.
>>> Envoyé depuis iCloud
>>>
>>> Le 16 nov 2011 à 09:28, Paul Yu <[email protected]> a écrit :
>>>
>>>> Raymond
>>>>
>>>> Some thing like this
>>>>
>>>> String baseFileName = someString();
>>>> String filename = pdfDocumentPrefix() + baseFileName + ".pdf";
>>>> configuration.takeValueForKey(filename, "filename");
>>>> WOResponse pdfReport = ERPDFUtilities.pageAsPdf(pdfPage,
>>>> configuration).generateResponse();
>>>>
>>>> return pdfReport;
>>>>
>>>> On Nov 16, 2011, at 12:24 PM, Raymond NANEON wrote:
>>>>
>>>>> Hi Ramsey,
>>>>>
>>>>> I use woongl in my page, the tag is not properly set. I would like to
>>>>> know why the fetching data is not finished and the pdf file is generated
>>>>> and how to change pdf file name.
>>>>>
>>>>> Thanks
>>>>>
>>>>> Envoyé de mon iPhone
>>>>>
>>>>> Le 16 nov. 2011 à 17:27, Ramsey Gurley <[email protected]> a écrit :
>>>>>
>>>>>> I'm not sure how it's becoming malformed for you, but I do know that the
>>>>>> PDF generator requires well formed xhtml. If you are missing end tags
>>>>>> or have an unencoded & anywhere, you're going to be disappointed.
>>>>>>
>>>>>> Ramsey
>>>>>>
>>>>>> On Nov 16, 2011, at 2:11 AM, Raymond NANEON wrote:
>>>>>>
>>>>>>> Hi All,
>>>>>>>
>>>>>>> I tried to generate a PDF file using ERPDFWrapper but I have a
>>>>>>> result.pdf file which is malformed. The page haven't time to get
>>>>>>> fetching data and the .pdf file is generated.
>>>>>>>
>>>>>>> So how Can I fix it.
>>>>>>>
>>>>>>> 1:/ get fetch data
>>>>>>> 2:/ generate pdf file from data
>>>>>>>
>>>>>>> PS : There is a way to change file name?
>>>>>>>
>>>>>>> thanks for your helps
>>>>>>> Envoyé depuis iCloud
>>>>>>>
>>>>>>> Le 08 nov 2011 à 09:28, Raymond NANEON <[email protected]> a écrit :
>>>>>>>
>>>>>>>> Thanks Ramsey and Pascal for the quick reaction and great help :D
>>>>>>>>
>>>>>>>> Ray
>>>>>>>> Envoyé depuis iCloud
>>>>>>>>
>>>>>>>> Le 08 nov 2011 à 09:29, Pascal Robert <[email protected]> a écrit :
>>>>>>>>
>>>>>>>>> BTW, that one is also on YouTube:
>>>>>>>>>
>>>>>>>>> http://www.youtube.com/wocommunity
>>>>>>>>>
>>>>>>>>> > Check out ERPDF in 60 seconds on the podcast:
>>>>>>>>> >
>>>>>>>>> > http://www.wocommunity.org/podcasts/wopodcasts.xml
>>>>>>>>> >
>>>>>>>>> > Ramsey
>>>>>>>>> >
>>>>>>>>> > On Nov 8, 2011, at 9:22 AM, Raymond NANEON wrote:
>>>>>>>>> >
>>>>>>>>> >> Hi All,
>>>>>>>>> >>
>>>>>>>>> >> I am trying to generate a PDF file from a page of my apps and I
>>>>>>>>> >> saw ERPDFGeneration plugin in the WONDER Library. I want to know
>>>>>>>>> >> if someone have used it and have a little tutorial to show me how
>>>>>>>>> >> it works.
>>>>>>>>> >>
>>>>>>>>> >> Thanks
>>>>>>>>> >> Envoyé depuis iCloud
>>>>>>>>> >> _______________________________________________
>>>>>>>>> >> Do not post admin requests to the list. They will be ignored.
>>>>>>>>> >> Webobjects-dev mailing list ([email protected])
>>>>>>>>> >> Help/Unsubscribe/Update your Subscription:
>>>>>>>>> >> http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com
>>>>>>>>> >>
>>>>>>>>> >> This email sent to [email protected]
>>>>>>>>> >
>>>>>>>>> > _______________________________________________
>>>>>>>>> > Do not post admin requests to the list. They will be ignored.
>>>>>>>>> > Webobjects-dev mailing list ([email protected])
>>>>>>>>> > Help/Unsubscribe/Update your Subscription:
>>>>>>>>> > http://lists.apple.com/mailman/options/webobjects-dev/probert%40macti.ca
>>>>>>>>> >
>>>>>>>>> > This email sent to [email protected]
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>>> Webobjects-dev mailing list ([email protected])
>>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>>> http://lists.apple.com/mailman/options/webobjects-dev/rnaneon%40me.com
>>>>>>>>
>>>>>>>> This email sent to [email protected]
>>>>>>> _______________________________________________
>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>> Webobjects-dev mailing list ([email protected])
>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>> http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com
>>>>>>>
>>>>>>> This email sent to [email protected]
>>>>>>
>>>>> _______________________________________________
>>>>> Do not post admin requests to the list. They will be ignored.
>>>>> Webobjects-dev mailing list ([email protected])
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> http://lists.apple.com/mailman/options/webobjects-dev/pyu%40mac.com
>>>>>
>>>>> This email sent to [email protected]
>>>>
>>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]