[xwiki-devs] Exposing PDF Export Options
Hi, I was writing a piece of code so that PDF export prints associated meta data of a page. Since I was in PDF macros code, I worked on a PDF export options page. By working on the PDF export options, I am using check boxes that allows user to choose to export or not cover page, toc page, metadata page attachments and comments. Issue I encountered is that when a check box is not checked it is not set and I found no way to use check boxes with actual code from pdfhtmlheader.vm page: #if("$!request.pdfcover" != '0') #set($displayPdfCover = 1) #else #set($displayPdfCover = 0) #end and the same for pdftoc (I could have put <input value="0"/> instead but it makes more sense to have <input value="1"/>) Therefore I am proposing that we: * update pdfhtmlheader.vm page so that cover and toc page are not exported by default * update existing pdf export button so that we keep the same behaviour (pdfcover and pdftoc printed in PDF), meaning instead of *page?format=pdf*it would be *page?format=pdf&pdftoc=1&pdfcover=1* Some UI will be needed afterward so that this page is exposed. (I am not planning to work on this.) The export options would be made in a template, but I put the code in this page of the incubator so that it makes things clearer if needed: http://incubator.myxwiki.org/xwiki/bin/view/PDFExport/ExportOptions Thanks for your feedback on pdfhtmlheader.vm modification and on the feature itself. -- Thibaut
Hi Thibaut, You work could probably be integrated as part of the Multipage export feature. See http://incubator.myxwiki.org/xwiki/bin/view/Improvements/MultiExport Check for example the PDF export options on http://incubator.myxwiki.org/xwiki/bin/view/Improvements/MultiExport2Proposa... Thanks -Vincent On Jan 27, 2011, at 11:47 PM, Thibaut Camberlin wrote:
Hi,
I was writing a piece of code so that PDF export prints associated meta data of a page. Since I was in PDF macros code, I worked on a PDF export options page.
By working on the PDF export options, I am using check boxes that allows user to choose to export or not cover page, toc page, metadata page attachments and comments. Issue I encountered is that when a check box is not checked it is not set and I found no way to use check boxes with actual code from pdfhtmlheader.vm page:
#if("$!request.pdfcover" != '0') #set($displayPdfCover = 1) #else #set($displayPdfCover = 0) #end and the same for pdftoc
(I could have put <input value="0"/> instead but it makes more sense to have <input value="1"/>)
Therefore I am proposing that we: * update pdfhtmlheader.vm page so that cover and toc page are not exported by default * update existing pdf export button so that we keep the same behaviour (pdfcover and pdftoc printed in PDF), meaning instead of *page?format=pdf*it would be *page?format=pdf&pdftoc=1&pdfcover=1*
Some UI will be needed afterward so that this page is exposed. (I am not planning to work on this.)
The export options would be made in a template, but I put the code in this page of the incubator so that it makes things clearer if needed: http://incubator.myxwiki.org/xwiki/bin/view/PDFExport/ExportOptions
Thanks for your feedback on pdfhtmlheader.vm modification and on the feature itself. -- Thibaut
From what I see Multipage export already plans to have those export options, right. But my development is about exporting as PDF when you are on the actual page, not in multipage export feature.
* Export ** Export as PDF *** PDF Export Options ** Export as RTF ** Export as HTML ** Export as XAR It is complementary. -- Thibaut On Fri, Jan 28, 2011 at 7:28 AM, Vincent Massol <[email protected]> wrote:
Hi Thibaut,
You work could probably be integrated as part of the Multipage export feature. See http://incubator.myxwiki.org/xwiki/bin/view/Improvements/MultiExport
Check for example the PDF export options on
http://incubator.myxwiki.org/xwiki/bin/view/Improvements/MultiExport2Proposa...
Thanks -Vincent
On Jan 27, 2011, at 11:47 PM, Thibaut Camberlin wrote:
Hi,
I was writing a piece of code so that PDF export prints associated meta data of a page. Since I was in PDF macros code, I worked on a PDF export options page.
By working on the PDF export options, I am using check boxes that allows user to choose to export or not cover page, toc page, metadata page attachments and comments. Issue I encountered is that when a check box is not checked it is not set and I found no way to use check boxes with actual code from pdfhtmlheader.vm page:
#if("$!request.pdfcover" != '0') #set($displayPdfCover = 1) #else #set($displayPdfCover = 0) #end and the same for pdftoc
(I could have put <input value="0"/> instead but it makes more sense to have <input value="1"/>)
Therefore I am proposing that we: * update pdfhtmlheader.vm page so that cover and toc page are not exported by default * update existing pdf export button so that we keep the same behaviour (pdfcover and pdftoc printed in PDF), meaning instead of *page?format=pdf*it would be *page?format=pdf&pdftoc=1&pdfcover=1*
Some UI will be needed afterward so that this page is exposed. (I am not planning to work on this.)
The export options would be made in a template, but I put the code in this page of the incubator so that it makes things clearer if needed: http://incubator.myxwiki.org/xwiki/bin/view/PDFExport/ExportOptions
Thanks for your feedback on pdfhtmlheader.vm modification and on the feature itself. -- Thibaut
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On Jan 28, 2011, at 9:27 AM, Thibaut Camberlin wrote:
From what I see Multipage export already plans to have those export options, right. But my development is about exporting as PDF when you are on the actual page, not in multipage export feature.
* Export ** Export as PDF *** PDF Export Options ** Export as RTF ** Export as HTML ** Export as XAR
It is complementary.
I think the idea is to have a single view to perform both single export and multiple exports, possibly with a simplified UI when exporting a single page (ie no need to choose the list of items to export or maybe keep it but have the current page preselected). Thanks -Vincent
-- Thibaut
On Fri, Jan 28, 2011 at 7:28 AM, Vincent Massol <[email protected]> wrote:
Hi Thibaut,
You work could probably be integrated as part of the Multipage export feature. See http://incubator.myxwiki.org/xwiki/bin/view/Improvements/MultiExport
Check for example the PDF export options on
http://incubator.myxwiki.org/xwiki/bin/view/Improvements/MultiExport2Proposa...
Thanks -Vincent
On Jan 27, 2011, at 11:47 PM, Thibaut Camberlin wrote:
Hi,
I was writing a piece of code so that PDF export prints associated meta data of a page. Since I was in PDF macros code, I worked on a PDF export options page.
By working on the PDF export options, I am using check boxes that allows user to choose to export or not cover page, toc page, metadata page attachments and comments. Issue I encountered is that when a check box is not checked it is not set and I found no way to use check boxes with actual code from pdfhtmlheader.vm page:
#if("$!request.pdfcover" != '0') #set($displayPdfCover = 1) #else #set($displayPdfCover = 0) #end and the same for pdftoc
(I could have put <input value="0"/> instead but it makes more sense to have <input value="1"/>)
Therefore I am proposing that we: * update pdfhtmlheader.vm page so that cover and toc page are not exported by default * update existing pdf export button so that we keep the same behaviour (pdfcover and pdftoc printed in PDF), meaning instead of *page?format=pdf*it would be *page?format=pdf&pdftoc=1&pdfcover=1*
Some UI will be needed afterward so that this page is exposed. (I am not planning to work on this.)
The export options would be made in a template, but I put the code in this page of the incubator so that it makes things clearer if needed: http://incubator.myxwiki.org/xwiki/bin/view/PDFExport/ExportOptions
Thanks for your feedback on pdfhtmlheader.vm modification and on the feature itself. -- Thibaut
On Fri, Jan 28, 2011 at 9:54 AM, Vincent Massol <[email protected]> wrote:
On Jan 28, 2011, at 9:27 AM, Thibaut Camberlin wrote:
From what I see Multipage export already plans to have those export options, right. But my development is about exporting as PDF when you are on the actual page, not in multipage export feature.
* Export ** Export as PDF *** PDF Export Options ** Export as RTF ** Export as HTML ** Export as XAR
It is complementary.
I think the idea is to have a single view to perform both single export and multiple exports, possibly with a simplified UI when exporting a single page (ie no need to choose the list of items to export or maybe keep it but have the current page preselected).
Right, this also what I read in the specs. But I see no screen addressing this issue. Maybe caty can tell us more about that? IMO when we want to export one page (most of the time) user should not see all those options. There should be 3 levels : - "Export as PDF" button that exports the page as usual (with toc and cover) - "PDF export options" that allows to select Cover, Toc, etc. - and a link to "Multipage Export" feature. Or maybe we will have one "Export" link from pages that bring to multipage export ?
Thanks -Vincent
-- Thibaut
On Fri, Jan 28, 2011 at 7:28 AM, Vincent Massol <[email protected]> wrote:
Hi Thibaut,
You work could probably be integrated as part of the Multipage export feature. See http://incubator.myxwiki.org/xwiki/bin/view/Improvements/MultiExport
Check for example the PDF export options on
http://incubator.myxwiki.org/xwiki/bin/view/Improvements/MultiExport2Proposa...
Thanks -Vincent
On Jan 27, 2011, at 11:47 PM, Thibaut Camberlin wrote:
Hi,
I was writing a piece of code so that PDF export prints associated meta data of a page. Since I was in PDF macros code, I worked on a PDF export options page.
By working on the PDF export options, I am using check boxes that
allows
user to choose to export or not cover page, toc page, metadata page attachments and comments. Issue I encountered is that when a check box is not checked it is not set and I found no way to use check boxes with actual code from pdfhtmlheader.vm page:
#if("$!request.pdfcover" != '0') #set($displayPdfCover = 1) #else #set($displayPdfCover = 0) #end and the same for pdftoc
(I could have put <input value="0"/> instead but it makes more sense to have <input value="1"/>)
Therefore I am proposing that we: * update pdfhtmlheader.vm page so that cover and toc page are not exported by default * update existing pdf export button so that we keep the same behaviour (pdfcover and pdftoc printed in PDF), meaning instead of *page?format=pdf*it would be *page?format=pdf&pdftoc=1&pdfcover=1*
Some UI will be needed afterward so that this page is exposed. (I am not planning to work on this.)
The export options would be made in a template, but I put the code in this page of the incubator so that it makes things clearer if needed: http://incubator.myxwiki.org/xwiki/bin/view/PDFExport/ExportOptions
Thanks for your feedback on pdfhtmlheader.vm modification and on the feature itself. -- Thibaut
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On 01/27/2011 11:47 PM, Thibaut Camberlin wrote:
Hi,
I was writing a piece of code so that PDF export prints associated meta data of a page. Since I was in PDF macros code, I worked on a PDF export options page.
By working on the PDF export options, I am using check boxes that allows user to choose to export or not cover page, toc page, metadata page attachments and comments. Issue I encountered is that when a check box is not checked it is not set and I found no way to use check boxes with actual code from pdfhtmlheader.vm page:
#if("$!request.pdfcover" != '0') #set($displayPdfCover = 1) #else #set($displayPdfCover = 0) #end and the same for pdftoc
You don't need to do that at all. The trick is to put: <label><input type="checkbox" value="1" name="pdfcover"/> Cover</label> <input type="hidden" value="0" name="pdfcover" /> If the checkbox is selected, the browser sends both values to the server: pdfcover=1&pdfcover=0 But request.pdfcover gets the first value it sees, 1. If the checkbox is unselected, the browser sends only the hidden value: pdfcover=0, so request.pdfcover will be 0. This is how the checkbox display of object properties is implemented as well. But yes, displaying the PDF options is something that I wanted to do as well, just that I never had the time for it.
(I could have put<input value="0"/> instead but it makes more sense to have <input value="1"/>)
Therefore I am proposing that we: * update pdfhtmlheader.vm page so that cover and toc page are not exported by default * update existing pdf export button so that we keep the same behaviour (pdfcover and pdftoc printed in PDF), meaning instead of *page?format=pdf*it would be *page?format=pdf&pdftoc=1&pdfcover=1*
Some UI will be needed afterward so that this page is exposed. (I am not planning to work on this.)
The export options would be made in a template, but I put the code in this page of the incubator so that it makes things clearer if needed: http://incubator.myxwiki.org/xwiki/bin/view/PDFExport/ExportOptions
Thanks for your feedback on pdfhtmlheader.vm modification and on the feature itself. -- Thibaut
-- Sergiu Dumitriu http://purl.org/net/sergiu/
On Fri, Jan 28, 2011 at 11:38 AM, Sergiu Dumitriu <[email protected]> wrote:
On 01/27/2011 11:47 PM, Thibaut Camberlin wrote:
Hi,
I was writing a piece of code so that PDF export prints associated meta data of a page. Since I was in PDF macros code, I worked on a PDF export options page.
By working on the PDF export options, I am using check boxes that allows user to choose to export or not cover page, toc page, metadata page attachments and comments. Issue I encountered is that when a check box is not checked it is not set and I found no way to use check boxes with actual code from pdfhtmlheader.vm page:
#if("$!request.pdfcover" != '0') #set($displayPdfCover = 1) #else #set($displayPdfCover = 0) #end and the same for pdftoc
You don't need to do that at all. The trick is to put:
<label><input type="checkbox" value="1" name="pdfcover"/> Cover</label> <input type="hidden" value="0" name="pdfcover" />
If the checkbox is selected, the browser sends both values to the server: pdfcover=1&pdfcover=0
But request.pdfcover gets the first value it sees, 1.
If the checkbox is unselected, the browser sends only the hidden value: pdfcover=0, so request.pdfcover will be 0.
This is how the checkbox display of object properties is implemented as well.
Hum, ok. I found that technique on the net but it seems I did not get the parameter correctly. Thanks for the info.
But yes, displaying the PDF options is something that I wanted to do as well, just that I never had the time for it.
Great. So is this going to be done via Multipage export (I am fine with that but we need to have a simplified UI for when you are on a page and what to export it, using options) or is it going to be stand alone (in which case I can polish my code and contribute on a jira to be created) ?
(I could have put<input value="0"/> instead but it makes more sense to have <input value="1"/>)
Therefore I am proposing that we: * update pdfhtmlheader.vm page so that cover and toc page are not exported by default * update existing pdf export button so that we keep the same behaviour (pdfcover and pdftoc printed in PDF), meaning instead of *page?format=pdf*it would be *page?format=pdf&pdftoc=1&pdfcover=1*
Some UI will be needed afterward so that this page is exposed. (I am not planning to work on this.)
The export options would be made in a template, but I put the code in this page of the incubator so that it makes things clearer if needed: http://incubator.myxwiki.org/xwiki/bin/view/PDFExport/ExportOptions
Thanks for your feedback on pdfhtmlheader.vm modification and on the feature itself. -- Thibaut
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (3)
-
Sergiu Dumitriu -
Thibaut Camberlin -
Vincent Massol