|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
makePDF output="output/book.pdf" - Can this be set dynamically?Hi All –
First time posting to the list, apologies for what is very likely a very basic question. I am very new to XSL FO and to Java, and I am trying to learn what I can about modifying publication types.
I have an existing custom pub type, created by someone else who is not available to ask, for PDF creation. It includes:
<publicationType xmlns="http://outerx.org/daisy/1.0#bookpubtype">
<label>GS-PDF-Book</label>
<startResource>output/book.pdf</startResource>
<other stuff…>
<publicationProcess>
<many of the documented tasks…>
<makePDF input="xml/book.fo" output="output/book.pdf" />
</publicationProcess>
</publicationType>
The file name of the pdf that is produced from this is, of course, ‘book.pdf’. I would like to be able to dynamically name the file based on a property or on book metadata.
The documentation suggests that this can be done, but I am not able to recognize where / how to do it. I have read through MakePdfTask.java, and Isee that these parms for
input and output are passed as strings, but that’s as far as I have gotten.
Basically I am wondering:
Apologies if this is a super-simple, beginner-type item and/or if I am missing an obvious part of the documentation or something.
Thanks,
JSR
_______________________________________________ daisy community mailing list Professional Daisy support: http://outerthought.org/en/services/daisy/support.html mail to: daisy@... list information: http://lists.cocoondev.org/mailman/listinfo/daisy |
|
|
Re: makePDF output="output/book.pdf" - Can this be set dynamically?You got me curious so I started to look around if this is possible. From the code it looks like the output name is copied verbatim from the xml and used. So no kind of parsing or replacement with variables going on there. Just have a look in the PublicationProcessBuilder.java
Paul On Fri, Sep 4, 2009 at 7:24 PM, Reddy, Joe <JReddy@...> wrote:
_______________________________________________ daisy community mailing list Professional Daisy support: http://outerthought.org/en/services/daisy/support.html mail to: daisy@... list information: http://lists.cocoondev.org/mailman/listinfo/daisy |
|
|
|
|
|
Re: makePDF output="output/book.pdf" - Can this be set dynamically?On Thu, Sep 10, 2009 at 1:44 PM, Reddy, Joe <JReddy@...> wrote:
> Hi All – > > First time posting to the list, apologies for what is very likely a very > basic question. I am very new to XSL FO and to Java, and I am trying to > learn what I can about modifying publication types. > > I have an existing custom pub type, created by someone else who is not > available to ask, for PDF creation. It includes: > > <publicationType xmlns="http://outerx.org/daisy/1.0#bookpubtype"> > <label>GS-PDF-Book</label> > <startResource>output/book.pdf</startResource> > <other stuff…> > <publicationProcess> > <many of the documented tasks…> > > <makePDF input="xml/book.fo" output="output/book.pdf" /> > > </publicationProcess> > </publicationType> > > > The file name of the pdf that is produced from this is, of course, > ‘book.pdf’. I would like to be able to dynamically name the file based on a > property or on book metadata. > The documentation suggests that this can be done, but I am not able to > recognize where / how to do it. I have read through MakePdfTask.java, and > Isee that these parms for > input and output are passed as strings, but that’s as far as I have gotten. > > Basically I am wondering: > > How can I access a property or variable during the process that reads from > the publicationtype.xml file? #include "I did not try this so I could be wrong.h" Now, I would suggest replacing the makePDF task with your own custom task (just start with copying the existing makePDF task). In the task, you can choose your own output filename. (You will have access to the publicationContext, hence to the bookMetaData). You probably run into problems with the 'startResource' thing, but I'm too tied up to figure out how to solve that. To work around it, consider creating an extension which reads the pdf file to the client, but which uses the Content-Disposition header to present another filename. > Would I somehow modify startResource, the output param for makePDF, or both? I think you need to modify both. as noted before: no idea how you would change the startResource > Has someone (or have many of you) already implemented something like this, > and will you share? > > Is there a large tutorial or archived list posting that I am missing? > > Apologies if this is a super-simple, beginner-type item and/or if I am > missing an obvious part of the documentation or something. Nope, you're probably the first to come up with the requirement. Regards, Karel > Thanks, > JSR > > > > _______________________________________________ > daisy community mailing list > Professional Daisy support: > http://outerthought.org/en/services/daisy/support.html > mail to: daisy@... > list information: http://lists.cocoondev.org/mailman/listinfo/daisy > > daisy community mailing list Professional Daisy support: http://outerthought.org/en/services/daisy/support.html mail to: daisy@... list information: http://lists.cocoondev.org/mailman/listinfo/daisy |
| Free embeddable forum powered by Nabble | Forum Help |