Re: ERPDFGeneration tutorial
Re: ERPDFGeneration tutorial
- Subject: Re: ERPDFGeneration tutorial
- From: Pascal Robert <email@hidden>
- Date: Wed, 07 Dec 2011 07:11:14 -0500
Have a look at ERJavaMail, you can send attachments with it.
http://wiki.objectstyle.org/confluence/display/WO/Project+WONDER-Frameworks-ERJavaMail
> Hi Paul,
>
> I would like to get the pdf file and sent it directly by mail with a method. How can I get the the file in the pdfReport component?
>
> Thanks for your help.
>
> Envoyé depuis iCloud
>
> Le 17 nov 2011 à 07:06, Paul Yu <email@hidden> a écrit :
>
>> Raymond
>>
>> Just change your css @page declaration.
>>
>> @page {
>> size:11in 8.5in; // change this to your paper size
>> margin:0.25in;
>> -fs-flow-top:"header";
>> -fs-flow-bottom:"footer";
>> -fs-flow-left:"left";
>> -fs-flow-right:"right";
>> padding:1em;
>> border:thin solid #ccc;
>> font-size:.8em;
>> }
>>
>>
>> Paul
>> On Nov 17, 2011, at 10:04 AM, Raymond NANEON wrote:
>>
>>> Hi Paul,
>>>
>>> I generate a great pdf file. Thanks
>>> I want to know if it's possible to generate a landscape dpf file?
>>>
>>>
>>> Envoyé depuis iCloud
>>>
>>> Le 17 nov 2011 à 05:12, Raymond NANEON <email@hidden> a écrit :
>>>
>>>> Hi Paul,
>>>>
>>>> I made tests and your generation pdf method work very well. I go use it to generate my specifique pdf file.
>>>> I will tell you.
>>>>
>>>> Ray
>>>> Envoyé depuis iCloud
>>>>
>>>> Le 17 nov 2011 à 03:06, Paul Yu <email@hidden> a écrit :
>>>>
>>>>> 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">
>>>>>
>>>>> <htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="en"lang="en">
>>>>> <head>
>>>>> <metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/>
>>>>> <title><wo:strvalue="$myObject.name"/></title>
>>>>> <wo:ERXStyleSheetfilename="css/style-print.css"media="print"/>
>>>>> </head>
>>>>>
>>>>> <body>
>>>>> <divclass="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@hidden> 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@hidden> 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@hidden> 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@hidden> 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@hidden> 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@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
>>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> 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