Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362282

Summary: PDF/A-1a and PDF/A-1b support
Product: z_Archived Reporter: Mika Tapanainen <mika.tapanainen>
Component: BIRTAssignee: Birt-ReportEngine-inbox <Birt-ReportEngine-inbox>
Status: NEW --- QA Contact: Liwen Chen <lchen>
Severity: enhancement    
Priority: P3 CC: bluesoldier, jozef.hribik, mail, s-lau, zimmermann.tho
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
sRGB.profile none

Description Mika Tapanainen CLA 2011-10-28 04:50:44 EDT
Build Identifier: All

Currently there is no support in the BIRT API to turn on/off the use of the PDF/A-1a, PDF/A-1b etc. standards. Howerer this is possible in the Birt source code:

"BIRT uses iText to generate PDF and iText has a setPDFXConformance 
method, but currently BIRT does not make this call in the PDF emitter.

PdfWriter writer = PdfWriter.getInstance(document,
new FileOutputStream(filename));
writer.setPdfVersion(PdfWriter.PDF_VERSION_1_4);
writer.setPDFXConformance(PdfWriter.PDFA1B)

I am not certain whether this means that the files BIRT produces are 
not compliant. You could always change the source and add the call.

Jason
"

See for the details http://www.eclipse.org/forums/index.php/t/259539/



Reproducible: Always
Comment 1 Mika Tapanainen CLA 2011-10-28 04:58:28 EDT
For example the fonts are not included in the PDF file by the default BIRT PDF. In my example file the Helvetica font was not included in the PDF file.
Comment 2 Jozef Hribik CLA 2016-04-20 04:50:46 EDT
It's annoying. I had to create my own PDF/A emitter plugin which differs from original PDF emitter version 4.4.2 only in some lines of code and color profile resource:

public class PDFPageDevice implements IPageDevice
{

    /* PDFA - color profile */
    public static final String COLOR_PROFILE = "/resource/sRGB.profile";

...

	public PDFPageDevice( OutputStream output, String title, String author,
			String subject, String description, IReportContext context,
			IReportContent report )
	{
		this.context = context;
		this.report = report;
		doc = new Document( );
		try
		{
			writer = PdfWriter.getInstance( doc, new BufferedOutputStream(
					output ) );

            // PDFA - start
            // disable Transparency
            writer.setRgbTransparencyBlending( false );
            // PDFA - end

			EngineResourceHandle handle = new EngineResourceHandle(
					ULocale.forLocale( context.getLocale( ) ) );

			String creator = handle.getMessage( MessageConstants.PDF_CREATOR,
					versionInfo );
			doc.addCreator( creator );

			if ( null != author )
			{
				doc.addAuthor( author );
			}
			if ( null != title )
			{
				doc.addTitle( title );
			}
			if ( null != subject )
			{
				doc.addSubject( subject );
				doc.addKeywords( subject );
			}
			if ( description != null )
			{
				doc.addHeader( "Description", description );
			}

            // PDFA - start
            writer.setPdfVersion(PdfWriter.PDF_VERSION_1_4);
            writer.setPDFXConformance(PdfWriter.PDFA1A);
            writer.setTagged();
            writer.createXmpMetadata();

            doc.open( );

            ICC_Profile icc = ICC_Profile.getInstance(this.getClass().getResourceAsStream(COLOR_PROFILE));
            writer.setOutputIntents("Custom", "", "http://www.color.org", "sRGB IEC61966-2.1", icc);

            // PDFA - end
		}
		catch ( Exception de )
		{
			logger.log( Level.SEVERE, de.getMessage( ), de );
		}
	}
Comment 3 Jozef Hribik CLA 2016-04-20 04:53:33 EDT
Created attachment 261106 [details]
sRGB.profile

Added sRGB.profile resource.