I’ll answer my own question 😊

        userAgent.getRendererOptions().put( 
PDFRendererOption.MERGE_FONTS.getName(), true );

Feels a bit odd because you’re not telling it which renderer, but works for our 
flow.  Had tried just PDFRendererOption.MERGE_FONTS previously, but simple 
string name is needed.

Mark
From: Mark Gibson <mark.gib...@staff.bluematrix.com>
Sent: 22 August 2022 22:57
To: fop-users@xmlgraphics.apache.org
Subject: Setting renderer merge-fonts from code

Hi.

I’m sure I’m missing something simple, but I’m looking to set the “merge-fonts” 
configuration via code on the FOUserAgent.  And I’m failing.

I’ve found how to read it, but there’s no setters:

            PDFRendererConfig rcfg = 
(PDFRendererConfig)userAgent.getRendererConfig( "application/pdf", new 
PDFRendererConfig.PDFRendererConfigParser() );
            PDFRendererOptionsConfig rocfg = rcfg.getConfigOptions();
            rocfg.getMergeFontsEnabled();

Does anyone know the magic?

Thanks
Mark

Reply via email to