| Summary: | PDF/A-1a and PDF/A-1b support | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Mika Tapanainen <mika.tapanainen> | ||||
| Component: | BIRT | Assignee: | 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
Mika Tapanainen
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. 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 );
}
}
Created attachment 261106 [details]
sRGB.profile
Added sRGB.profile resource.
|