Logo
Zoho Forums

Cycle 2: HTML View To PDF

by 
 on 16-Aug-2009 06:45 AM.
  in  Zoho Creator 

As you will see here ... http://forums.zoho.com/#Topic/2266000000398836 ... the suggestion made by user deepa7476 (HTML View to PDF - http://forums.zoho.com/?ftid=2266000000361648) was voted by the Community as the one to be developed by the dedicated resource at the ZOHO Creator Team.

I have opened this post so that all details pertaining to the design, development, testing and implementation of this feature can be discussed in a central place.

I urge Charles to begin by posting the proposed method of implementing this feature ... so the community can comment on it before any coding takes place.


Gaev

  • No status
  2 users find this useful 

Re: Cycle 2: HTML View To PDF

by 
 on 16-Aug-2009 06:58 AM

Let me kick start this discussion by suggesting that this feature also support the non-interactive creation of such PDF files.

Although I have not seen details of the soon to be released "Scheduler" feature, it would be imensely more beneficial if Applications could be designed so the "creration of HTML Views in PDF files" could be scheduled (e.g. nightly, weekly or monthly reports) at a time of inactivity.

In order that the user/Admin does not have to be logged in to the Application just so he/she can trigger the creation of such reports, it would be nice to have a mechanism for specifying a target location (within the Application's Database (e.g. a File Upload Field in a Form) where the PDF file could be stored.

Such a mechanism would also help reduce the demands on the hosting hardware in instances where the same report was to be made available to a large number of Users ... instead of each User requesting it to be re-created ... the Application could be designed such that users would just download the PDF file from the specified target location.


Gaev

Re: Cycle 2: HTML View To PDF

by 
 on 16-Aug-2009 09:20 PM

Thank you Gaev

it would be imensely more beneficial if Applications could be designed so the "creration of HTML Views in PDF files" could be scheduled (e.g. nightly, weekly or monthly reports) at a time of inactivity.
 
I can releate to this . This will indeed be an added feature.

As for the converting HTML view to PDF, I was thinking may be we can have a small "create to pdf" icon at HTML view... like the ones we see in blogs etc.

Additionally, I would like to suggest at the HTML view - Edit , at the drop down that shows "permalink", the application owner can "enable / disable"convert to pdf

PS:- Do i need to start a seperate thread for  Implimentaion Details  HTML view - PDF or.. would it be okay if this thread itself was renamed ?

Thank you,

Best Regards

-Deepa Govind

Re: Cycle 2: HTML View To PDF

by 
 on 17-Aug-2009 05:55 AM

Deepa:

As for the converting HTML view to PDF, I was thinking may be we can have a small "create to pdf" icon at HTML view... like the ones we see in blogs etc.
Perhaps we (I) should wait for the ZOHO Creator Team to advise us of the proposed implementation details ... but if you see on this page ... http://zohocreator.wiki.zoho.com/Zoho-Creator-URL-Patterns.html ... they have a pattern for producing List View content in a PDF file ...

For example the url, http://creator.zoho.com/sampleapps/lottery-application/pdf/Application_Form_View/ will generate data from http://creator.zoho.com/sampleapps/lottery-application/#View:Application_Form_View in PDF format.

... so it might be more flexible for the developer to design his/her own mechanism (prompt/lnik) for enabling a user to request a PDF copy of a regular HTML View that is being displayed.

In either case (Developer or ZOHO prompted) ... measures would have to be taken to ensure that the PDF content NOT have this "prompt" included within it ... as it would confuse the reader of the PDF file.

A Developer could implement this via an additional parameter in the url ... and have logic (Deluge commands) to render such a prompt (or not) e.g.

myApp/#View:myHTML?PromptForPDF=Yes

myApp/pdf/#View:myHTML?PromptForPDF=No
Additionally, I would like to suggest at the HTML view - Edit , at the drop down that shows "permalink", the application owner can "enable / disable"convert to pdf
I agree that a Developer should be able to control whether a User can/can not produce a PDF file from an HTML View ... but (again), it might be better controlled in Run Mode ... so for example when rendering the HTML View to UserA, he/she might not be given the opportunity to get a PDF copy ... while zoho.adminuser (or UserB) would be prompted.

In general I find that providing options at Run time provides a more flexible architecture than something that is specified (albeit more easily with point and click options) at Edit time ... my 2 cents
PS:- Do i need to start a seperate thread for  Implimentaion Details  HTML view - PDF or.. would it be okay if this thread itself was renamed ?
Might be easier to follow if all (pre-delivery) discussions were organized in this one post ... if it becomes too long, we could start a second that was serially connected to this one.


Gaev

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 17-Aug-2009 02:30 PM

Dear Users,

We will come up with initial implementation details in a day. Meanwhile, keep your inputs coming.

Thanks,
Hariharan

Re: Cycle 2: HTML View To PDF

by 
 on 17-Aug-2009 03:40 PM

Hariharan:

Meanwhile, keep your inputs coming
This is more of a question than a suggestion ... but will the pdf output be a "replica of the HTML View rendered on screen" ?

My previous experience in creating PDF files has been through "virtual printer drivers" ... which ask for parameters like width, height and margins of each page ... I am wondering if there will be a similar requirement with this feature ... or will you render it "as on screen" e.g. 35 columns of an HTML Table ?


Gaev

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 18-Aug-2009 01:16 PM

Dear Gaev,

We are to explore more. But the possible size options will be printer friendly sizes like Letter, A4,Legal,Executive and orientation like portrait, landscape.

We believe the margin options need not be asked from users as the html output itself will be properly aligned.

Thanks,
Hariharan


Re: Cycle 2: HTML View To PDF

by 
 on 21-Aug-2009 06:53 AM

Would you be considering unicode option as well. ?

Its not that all users will be using only english .

-Deepa Govind

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 21-Aug-2009 06:54 AM

Dear Users,

We are planning to offer the following:

1).We will provide an url based pdf export similar to normal views.
The url will be similar to normal views like http://creator.zoho.com/<username>/<application name>/pdf/<html view link name>/
The developers can use this url to dynamically generate reports based on user inputs.

2).We will provide an option in the edit mode similar to the print option currently available in edit mode for the html view.
This will generate an export pdf button at the top header of the html view automatically. This button will in-turn automatically redirects to the above mentioned pdf url. This is just a quick way to generate an export pdf button for the novice users.

3).Pdf as attachment.
We are rolling out attachment feature in sendmail task along with scheduler. It will support the ability to attach normal views in pdf/xls/csv formats. We will extend this to support html view also as Pdf attachment.

We will give these features in the above mentioned order. We will give you the expected release time once the community also is in agreement with these options.

Others Details:
1).Regarding the option to store the report as attachment in the file upload field. This is a nice feature. However, this feature may not be done within the time frame suggested for this community feature. We will explore more on the implementation and time needed and feasibility for supporting this option and get back to you.

Thanks,
Hariharan

Re: Cycle 2: HTML View To PDF

by 
 on 21-Aug-2009 07:37 AM

Hariharan:

Thank you for the feedback.

The url will be similar to normal views like http://creator.zoho.com/<username>/<application name>/pdf/<html view link name>/

Please provide an example url that shows how parameters (for the HTML View) will be specified.


Gaev

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 25-Aug-2009 06:05 AM

Dear Gaev,


Consider an 'EmployeeDetails' html view in an employeemanager application. The view perma link will look like.
http://creator.zoho.com/hariharan/employeemanager/view-perma/EmployeeDetails

Passing parameter will be like below:
http://creator.zoho.com/hariharan/employeemanager/view-perma/EmployeeDetails/ename=hariharan

Similarly for pdf, the url will be like below:
http://creator.zoho.com/hariharan/employeemanager/pdf/EmployeeDetails/ename=hariharan

Thanks,
Hariharan

Re: Cycle 2: HTML View To PDF

by 
 on 25-Aug-2009 06:53 AM

Hariharan:

Thanks.


1) How about when more than one parameter is being passed ?


2) Also, can these be triggered using openurl and relative link URLs e.g. similar to ...

openurl("#View:EmployeeDetails?ename=hariharan&status=active","same window");


Gaev

Re: Cycle 2: HTML View To PDF

by 
 on 26-Aug-2009 08:08 AM

Very interesting.

Will we be able to preset the name of the PDF file like the following :

"Invoice number - " + <%=invoice.invoiceNumber%> + ".pdf"

Thanks.

Pascal | nsisolution

Re: Cycle 2: HTML View To PDF

by 
 on 26-Aug-2009 09:11 AM

Pascal:

In an earlier Post within this Topic, I asked/suggested ...

it would be nice to have a mechanism for specifying a target location (within the Application's Database (e.g. a File Upload Field in a Form) where the PDF file could be stored.
... to which hariharan responded ...
Regarding the option to store the report as attachment in the file upload field. This is a nice feature. However, this feature may not be done within the time frame suggested for this community feature. We will explore more on the implementation and time needed and feasibility for supporting this option and get back to you.
I think you are asking for the same kind of facility (i.e. automatic store of resulting PDF file instead of sending it back to the User's Browser) ... only with a different method of implementation.


Gaev

Re: Cycle 2: HTML View To PDF

by 
 on 26-Aug-2009 11:41 AM

Gaev,

I don't care if it goes to user browser. But when I clic SAVE, I don't want to name the file manually, I just want to choose the location in my computer.

Pascal 

Re: Cycle 2: HTML View To PDF

by 
 on 26-Aug-2009 02:13 PM

Pascal;

I don't want to name the file manually, I just want to choose the location in my computer.
Ok, I see that this is a slightly different requirement ...I'll let Hariharan respond to it.


Gaev

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 27-Aug-2009 02:29 AM

 @Gaev

Please find my answers below.


 1) How about when more than one parameter is being passed ?

It will be by appending ampersand as shown below.
http://creator.zoho.com/hariharan/employeemanager/pdf/EmployeeDetails/ename=hariharan&age=34&qualification=MS

 

2) Also, can these be triggered using openurl and relative link URLs e.g. similar to ...

openurl("#View:EmployeeDetails?ename=hariharan&status=active","same window");

Mostly, these relative urls are for navigating around in the application layout. These urls will not work if invoked from perma link. I guess your requirement will be to construct a pdf export url that will be portable from one user to another and one application to another. I am also hoping that your requirement will not be to convert the application along with the layout information to pdf.

You can achieve that by using the 'zoho.appname' and 'zoho.adminuser' functions in deluge.

openurl("http://creator.zoho.com/"+
zoho.adminuser+"/"+zoho.appname+"/pdf/EmployeeDetails/ename=hariharan&status=active","same window");
or
openurl("/"+zoho.adminuser+"/"+zoho.appname+"/pdf/EmployeeDetails/ename=hariharan&status=active","same window");

Thanks,
hariharan

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 27-Aug-2009 03:10 AM

@Pascal

That should not be a problem. We will provide an extra 'zc' operator to pass the output filename eg: zc_pdf_filename. However currently this can be supported only for the url based pdf export (2nd in our list of offerings.). eg:

http://creator.zoho.com/hariharan/employeemanager/pdf/EmployeeDetails/ename=hariharan&zc_pdf_filename=Aug26_Report

Note:  If no 'zc_pdf_filename' parameter is passed, then by default 'view display name' will be chosen as file name.


@Users
Having collected the requirements we will start the coding. We will try our best to release the initial version in 2 weeks time (around 16nd September)


Get back to me for any clarification in this regards.

Thanks,
Hariharan

 

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 02-Sep-2009 11:31 AM
Dear Users,

While analyzing the implementation details, we have come across the handling of div based embeddings of forms and views inside html view. These div based embeddings are client side javascript(ajax) based. Hence we cannot support pdf export for them as pdf generation will be done on the server side.

Instead of these div based embeddings where some code snippets have to be embedded in html, if we provide inbuilt server side include support in deluge (something like #include of another view/form/html view) then current difficulty in pdf export will be solved and also we could provide lot of other enhancements.

Some enhancements we can provide with new embedding are:
1).Provide the choice of loading. i.e whether to load the view/form through ajax request or load it along initially with the html view.
2).Handle automatic renaming of view link names.
3).Embedding one html view into another will become seemless. For example, you can create a single html view for header and use it across in all html views.

Also, sharing could be inherited from the parent html view. You need not share the individual html views.
4).Ability to control options like show all rows without paging in case of pdf. etc..

Hence we have arrived at the following order of supporting it.

1).Initially provide pdf support for html views without supporting the embedded forms/views.

2).Then provide server side include, which once supported will make the embedding in html view work with a little bit of modifications.

 
However, please note that the previous div based embeddings will work as expected in all the currently supported ways as for now, though we plan to deprecate them in the future.

Thanks,
Hariharan

Re: Re: Cycle 2: HTML View To PDF

by 
 on 21-Sep-2009 12:52 AM

Dear Hariharan

Do you have an update on the implementation schedule? The 16th of September has passed.

Thanks, Filip

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 21-Sep-2009 01:07 AM

Dear Filip,

The implementation is being done. It will take atleast two more weeks.  Kindly bear with us.

Thanks,
Hariharan

 

Re: Cycle 2: HTML View To PDF

by 
 on 05-Oct-2009 06:19 PM

 Hi Hariharan,

Do you have a new date ?

Thanks,

Pascal | nsisolution

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 06-Oct-2009 01:24 AM

 Dear Pascal,


The basic implementation is over. We have to handle certain cases like input parameters and other zc_ arguments. We will make an initial release by next week end. Please note that, as already discussed, this release will not include the support for embedded forms/views. Will only support views created from scratch completely using html and deluge script.

Thanks,
Hariharan

Re: Cycle 2: HTML View To PDF

by 
 on 18-Oct-2009 04:01 AM

Dear Hariharan

Is the release done?
I tested a pdf link and didn't get it to work.

Regards, Filip

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 20-Oct-2009 02:29 AM

 Dear Filip,


The implementation is over. We are testing the functionality. We will release it in a few days. Kindly bear with us.

Thanks,
Hariharan

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 22-Oct-2009 09:27 AM

Dear Users,

We have made an initial release. 

The usage is similar to view-perma. Passing argument is also similar to view-perma. In addition, zc_FileName is supported. We will soon update the help document.

Some examples.

1).First Example:

View Perma Link : http://creator.zoho.com/hariharan/pdfexample/view-perma/zohoapps

View Pdf Link : http://creatorexport.zoho.com/hariharan/pdfexample/pdf/zohoapps

View Pdf Link with file name: http://creatorexport.zoho.com/hariharan/pdfexample/pdf/zohoapps/&zc_FileName=PdfReport2_Oct22


2).Second Example with arguments:

View Perma Link : http://creator.zoho.com/hariharan/pdfexample/view-perma/Detailed_Lead_View2/&lead_idstr=9996000003524007

View Pdf Link : http://creatorexport.zoho.com/hariharan/pdfexample/pdf/Detailed_Lead_View2/&lead_idstr=9996000003524007

View Pdf Link with file name: http://creatorexport.zoho.com/hariharan/pdfexample/pdf/Detailed_Lead_View2/&lead_idstr=9996000003524007&zc_FileName=PdfReport_Oct22


Limitations:

1).Div embedded forms/views inside html view not supported as already discussed.(Will be done only after we provide #include support. i.e server side include directive in deluge. And users have to change to new implementation once done to enable pdf output).

2).Any authenticated content like images/css that requires your current credential will not be supported. i.e Any link/embedding in the html to be converted pdf should be public content.

3).Any css/images and other links to be rendered have to be specified in full path

eg: /images/xyz.jpg will not be properly rendered. But http://creator.zoho.com/images/xyz.jpg will be properly rendered.


Next Pdf Related Update:

1).Next pdf related update will include the option to automatically show export pdf link at the top of the html view similar to the 'Print' option when enabled in the edit mode.


Thanks,
Hariharan

Re: Cycle 2: HTML View To PDF

by 
 on 29-Oct-2009 09:29 PM

 Thank you team.


 The usage is similar to view-perma. Passing argument is also similar to view-perma. In addition, zc_FileName is supported.
Perfect, I tested each one of them individually and all is working just the way its expected to be.
The images are comming out perfect when the complete img url is used.
The parameters & pdf name is working fine. 

Until the team's update for "export to pdf" link at HTML view, we are happy using a dynamically generated link inserted into our HTML page. ..(ofcourse, this link also shows up in the pdf file... but thats okay for now)

Thanks for listening, ZC team.
Thanks for participating, ZC enthusiasts.
& special thanks to Gaev, towards the community driven intiative.

Best Regards

-Deepa Govind

Re: Cycle 2: HTML View To PDF

by 
 on 30-Oct-2009 05:58 AM

Deepa Govind:

Thank you for testing/verifying this feature ... I will do some of my own testing this weekend.

Until the team's update for "export to pdf" link at HTML view, we are happy using a dynamically generated link inserted into our HTML page. ..(ofcourse, this link also shows up in the pdf file... but thats okay for now)
You can avoid the link from showing up in the PDF file by passing an additional parameter in the url (for your HTML View) ... e.g. ShowPDFLink=yes ... and then check for the value of this passed parameter ...
  1. if (input.ShowPDFLink == "yes")
  2. {
  3.    //insert the code for the link here
  4. }
Now, when composing the link for viewing the HTML View, you insert the text ShowPDFLink=yes into the url ... but when composing the link for PDF'ing (or printing) it, you omit it.


Gaev

Re: Cycle 2: HTML View To PDF

by 
 on 04-Nov-2009 04:43 PM

Using to send emails with the pdf file url.  The file has integrated google map and all is beautiful!  Thank you!

Re: Cycle 2: HTML View To PDF

by 
 on 14-Nov-2009 07:18 AM

 Only getting blank pages now.

Re: Cycle 2: HTML View To PDF

by 
(Employee)
 on 17-Nov-2009 06:50 AM

@smspdd,

Could you please provide edit access to support to your application so that we can help you in this regard.

To provide edit access to support,

  • Go to the Edit mode of the application and click on Share tab.
  • Click on the link "Allow edit access to support " to allow edit access.


Also please mention the name of the application and the name of the html view in which you are facing this problem.

Regards,
Karuppuchamy.

Re: Re: Cycle 2: HTML View To PDF

by 
 on 19-Nov-2009 08:53 AM

 Hi Karuppuchamy,

It's working now.  But just so you know it was happening with not only my application but on Hariharan's links above last week across both PC and Macs here at work and at home.  Not sure what the issue was but it seems to be fixed now.  Thanks for your response.

I do have another question: Is there a way to force or select a portrait vs. lanscape orientation for the pdf output?

Re: Cycle 2: HTML View To PDF

by 
 on 19-Nov-2009 09:30 AM

@ ZOHO Creator Team:

It's working now.  But just so you know it was happening with not only my application but on Hariharan's links above last week across both PC and Macs here at work and at home.  Not sure what the issue was but it seems to be fixed now.
Why would something that worked before ... stop working momentarily ... and then work again ... without any changes within the Application(s) ?

I do not know of any changes made to this facility (or any other within ZOHO Creator) ... such inexplicable events warrant an explanation from the ZOHO Creator Team.


@smsdd:
I do have another question: Is there a way to force or select a portrait vs. lanscape orientation for the pdf output?
In his Aug/18 post of this (now long) Topic, Hariharan said ...

We are to explore more. But the possible size options will be printer friendly sizes like Letter, A4,Legal,Executive and orientation like portrait, landscape.
... but I do not see any parameter in his documentation that allows a user to specify this ... Hariharan, please explain what happened to this feature.



Gaev

Re: Cycle 2: HTML View To PDF

by 
(Moderator)
 on 20-Nov-2009 03:32 AM

 Dear Gaev,




 Why would something that worked before ... stop working momentarily ... and then work again ... without any changes within the Application(s) ?
When the issue was reported that the pdf was not working, we tested our own links and they were working fine, so we thought it has something specific to the user like any application corruption. Later found out, that none of the links were  working for the user (But was working fine when we tested it).
It is the only reported case of this event and we haven't changed anything on our side and hence it should be some rare network timeout/specific system overload. We will watch out this space to prevent any such issues in the future. We regret any inconvenience caused.


@smspdd @gaev

Regarding the pdf parameters, we will expose the orientation(Portrait, Landscape) and size(Letter, A4, Legal, Executive). Please note that these are printer friendly options and accordingly the pdf will be generated to suit these sizes when printed. We are already working on it and will be updated in th online build in a week or two. Also, note that corresponding zc_ variable will be made available to specify these parameters.

Thanks,
Hariharan

Re: Re: Cycle 2: HTML View To PDF

by 
 on 20-Nov-2009 07:35 AM

I look forward to the upgrade.

Thanks Hariharan!

 Back
 Top
Post Actions
Statistics
  • 34
     Replies
  • 1137
     Views
  • 3
     Followers
Tags for the post
No tags available for this topic.

Edit Link Delete Link

Edit Link Delete Link

LoadingImage