Cannot create PDF/A documents

287 views
Skip to first unread message

Shervin Asgari

unread,
May 22, 2009, 5:37:39 AM5/22/09
to jodcon...@googlegroups.com
Hi.

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?

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.

Shervin

Shervin Asgari

unread,
May 22, 2009, 6:03:30 AM5/22/09
to jodcon...@googlegroups.com
I also get a PDF version 1.4 in the output. Why isn't it 1.6 like many other pdf's I have?

Shervin

Mirko Nasato

unread,
May 22, 2009, 6:58:35 AM5/22/09
to jodcon...@googlegroups.com
Hi Shervin,

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

Shervin Asgari

unread,
May 22, 2009, 1:22:31 PM5/22/09
to jodcon...@googlegroups.com
Hi Mirko

On Fri, May 22, 2009 at 12:58 PM, Mirko Nasato <mirko....@gmail.com> wrote:

Hi Shervin,

You're using JODConverter 2.2, not 3.0, right? 

Yes thats right, I didn't know 3.0 was out. Its still in beta?


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.

LOL! I am glad you saw that :-)



>
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.

Aha, No I just need it to be PDF/A. I don't care about 1.4 or 1.6. I just thought it may have something to do with it :-)
 

Shervin

Kamal C

unread,
Jun 18, 2014, 5:40:39 AM6/18/14
to jodcon...@googlegroups.com
Hi Team,

I'm trying for docx to pdf conversion using JODConverter 3.0 API, it is converting but iam unable to open in Adobe 11.0 Reader but iam able to open in Open Office 4.1.0.

Pls. help.

Thanks
Kamal
Reply all
Reply to author
Forward
0 new messages