You're using JODConverter 2.2, not 3.0, right?
2009/5/22 Shervin Asgari <shervin...@gmail.com>:
>
>>
>> I am calling this method:
>> converter.convert(doc, out, toFormatPDFA());
>>
>>
>> private DocumentFormat toFormatPDFA() {
>> // create a PDF DocumentFormat (as normally configured in
>> document-formats.xml)
>> DocumentFormat customPdfFormat = new DocumentFormat("Portable
>> Document Format", "application/pdf", "pdf");
>>
>> // now set our custom options
>> customPdfFormat.setExportFilter(DocumentFamily.TEXT,
>> "writer_pdf_Export");
>> /*
>> * For some reason "PDF/A-1" is called "SelectPdfVersion"
>> internally; maybe they plan to add other
>> * PdfVersions later.
>> */
>> Map pdfOptions = new HashMap();
>> pdfOptions.put("SelectPdfVersion ", this.PDFX1A2001); //1
>> customPdfFormat.setExportOption(DocumentFamily.TEXT, "FilterData",
>> pdfOptions);
>> return customPdfFormat;
>> }
>>
>> However, when I open the pdf in Adobe Reader 9.1.0 it doesnt say that the
>> pdf is PDF/A
>>
>> Am I missing something? Why isn't my document converted to PDF/A here?
>>
Looks like there's a trailing space in "SelectPdfVersion " passed to
pdfOptions.put(). OOo will just ignore any options it doesn't
recognise.
>> Also, when I didnt set the DocumentFamiliy.TEXT, "writer_pdf_Export", I
>> didnt get the correct exception from jodconverter.
>> I got "IllegalArgumentException, cannot convert from doc to Portable
>> Document Format" (something like that) instead of the exception thrown when
>> a DocumentFamily is not set.
>>
If you omit setExportOption(DocumentFamiliy.TEXT, "writer_pdf_Export")
to the converter that means that TEXT documents cannot be converted to
your custom format, i.e. converting from doc to pdf is not supported.
It's like if you tried to convert from say xls to ppt: ppt is only
valid as an output if the family is PRESENTATION, but xls is
SPREADSHEET so you're attempting an invalid conversion.
>
> I also get a PDF version 1.4 in the output. Why isn't it 1.6 like many other
> pdf's I have?
>
Do you need any PDF 1.6 feature? All PDFs generated by OOo are 1.4
AFAIK, so they're compatible with Acrobat 5 or later. And the PDF/A-1
standard is based on 1.4 anyway.
Cheers
Mirko
Hi Shervin,
You're using JODConverter 2.2, not 3.0, right?
2009/5/22 Shervin Asgari <shervin...@gmail.com>:
>Looks like there's a trailing space in "SelectPdfVersion " passed to
>>
pdfOptions.put(). OOo will just ignore any options it doesn't
recognise.
Do you need any PDF 1.6 feature? All PDFs generated by OOo are 1.4
>
AFAIK, so they're compatible with Acrobat 5 or later. And the PDF/A-1
standard is based on 1.4 anyway.