RE: Setting renderer merge-fonts from code

Mark Gibson <[email protected]>
Newsgroups gmane.text.xml.fop.user
Message-ID <DM5PR04MB05382DF3E0B91D7E4E4B6189DD709@DM5PR04MB0538.namprd04.prod.outlook.com>
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 <[email protected]>
Sent: 22 August 2022 22:57
To: [email protected]
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.