CSS to PDF Transform -- Prompt for File

cud
Posts: 37
Joined: Fri Oct 06, 2017 5:22 pm

CSS to PDF Transform -- Prompt for File

Post by cud » Wed Nov 21, 2018 11:48 pm

I'm using the CSS to PDF transform, and I use a CSS template. A Prompt for File option (like what I can set for an XSLT transform) would be great.

My use case is that I generate lots of release notes -- I pull in JIRA output, then transform to PDF. I always need to generate a PDF with a filename that represents the product version, and the version always changes. So I can't make a separate transform for each version. Instead, I generate a PDF to the output directory, and then I must manually save as, or move to, the filename and location that I really want.

Dan
Posts: 395
Joined: Mon Feb 03, 2003 10:56 am

Re: CSS to PDF Transform -- Prompt for File

Post by Dan » Fri Nov 23, 2018 1:10 pm

If you need to transform multiple documents (the JIRA output for each product version) to PDF, I recommend creating a script that invokes the DITA-OT multiple times. If you are using an oxygen publishing template to store the customization, you can use the pdf.publishing.template parameter to point to that directory. The parameters that can be used in the transformation are documented here: https://www.oxygenxml.com/doc/versions/ ... eters.html

As a hint: make a transformation from oXygen, then take a look at the command line it uses for the PDF transformation (you can enable it from Options/Preferences/DITA/Show Console). Copy this command line into a script file and duplicate it for each of the input files.

cud
Posts: 37
Joined: Fri Oct 06, 2017 5:22 pm

Re: CSS to PDF Transform -- Prompt for File

Post by cud » Fri Nov 23, 2018 11:10 pm

Hi Dan...

Thanks but I think I didn't explain my request very well. I don't want to automate multiple transforms or anything like that. What I do is once or twice a week I make a PDF file for a specific release. So the jobs are piecemeal, and not batch.

Here's the workflow I would like:
1 Prepare my files for fixed issues, version x
2 Prepare my files for known issues, version x
3 Invoke my CSS to PDF transform
4 Choose the file path and name to save the generated PDF, and run the transform
5 Lather, rinse, repeat

Step 4 is the feature request.

When you edit an XML with XSLT scenario, you can open the OUTPUT tab, and set OUTPUT FILE... You can specify the filename with the transform, or you can choose to have oXygen prompt you for the output filename. With the prompt setting, I am able to transform my JIRA files to DITA using the above workflow. This saves me a lot of time...

When you edit a DITA-OT scenario, for the OUTPUT you can specify Base Directory, Temporary Files Directory, and Output Directory. But you cannot specify the filename, and you cannot specify to have oXygen prompt you for the output filename. All I want is to have a specific scenario for my release notes, and be able to choose the filename and location of the PDF file when I invoke it.

Dan
Posts: 395
Joined: Mon Feb 03, 2003 10:56 am

Re: CSS to PDF Transform -- Prompt for File

Post by Dan » Mon Nov 26, 2018 2:44 pm

Thank you for the details!
We will check if it is possible to change the name of the output file.

Many regards,
Dan

Dan
Posts: 395
Joined: Mon Feb 03, 2003 10:56 am

Re: CSS to PDF Transform -- Prompt for File

Post by Dan » Tue Nov 27, 2018 11:03 am

Hello,
I checked the plugin. In PDF2 (the DITA-OT default plugin for PDF) there is an args.output.base parameter that lets you specify the name of the file without extension. I added an issue for that, we should add support for this parameter in the CSS to PDF based transformation as well.

Many regards,
Dan

Dan
Posts: 395
Joined: Mon Feb 03, 2003 10:56 am

Re: CSS to PDF Transform -- Prompt for File

Post by Dan » Tue Nov 27, 2018 12:01 pm

Looking closer in the pugin source, I found an hidden parameter that can be used for the purpose.

You should set it manually, as it is not shown in the list of parameters in the transformation scenario dialog:
outputFile: ${ask('Enter the full path for the pdf:')}

Be aware that oXygen will not open it at the end of the transformation, actually it may open the first PDF file from the output folder. We will fix this in the next release.

Regards,
Dan

cud
Posts: 37
Joined: Fri Oct 06, 2017 5:22 pm

Re: CSS to PDF Transform -- Prompt for File

Post by cud » Tue Nov 27, 2018 4:00 pm

Very nice... It cuts a significant amount of the mustard. Thanks!

Post Reply