[ 
https://issues.apache.org/jira/browse/PDFBOX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14112945#comment-14112945
 ] 

Petr Slaby commented on PDFBOX-2144:
------------------------------------

{quote}
I think you'll just have to make sure that you don't change the configuration 
while pages are rendering.
{quote}
That is not possible. The application is big, pdf rendering just a small part 
of it. I cannot change the whole application for the sake of it. As mentioned 
before, the application is designed to accept a new config at any time. The new 
config is supposed to be valid for jobs started after its activation, while the 
previously started and  yet-not-finished jobs have to continue using the old 
one.

{quote}
 it'll play nice with PDFBox's internal static state 
{quote}
You scare me. What is static and where? I believed that state is bound to 
instances of PageDrawer or PDGraphicsState and the like.

I do not have enough insight to really understand all your reasons, but... if 
FileSystemFontProvider is implemented as a singleton then it will do the same 
as it is doing now when being called from a static method of ExternalFonts. 
Just replace your static methods by a factory and bind the instance to 
somewhere (I thought PageDrawer or PDFStreamEngine is the right place) - and we 
are on the same boat :-)

However, as mentioned before, I think I will be able to bind my font 
configurations to thread instances so that this is not such a big issue for me 
and your current solution should be fine.

> Provide a pluggable font manager
> --------------------------------
>
>                 Key: PDFBOX-2144
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2144
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Rendering
>            Reporter: Petr Slaby
>            Assignee: John Hewson
>         Attachments: FontManager.patch
>
>
> Our J2EE application has all fonts and resources configured and stored in its 
> database. No files are accessed directly from file system or from system 
> environment. To make PDFBox compatible with this philosophy, we need the 
> FontManager in pdfbox and fontbox to be pluggable, e.g. as shown in the 
> attached patch.
> The proposal defines a FontManager interface and default implementation which 
> is the original one. FontManager then needs to be configured on and 
> propagated from PDFStreamEngine and PageDrawer. It should also be 
> configurable on PDFRenderer, which is not shown in the patch. There I would 
> suggest to introduce a configuration object which would take care about all 
> the current and future options of PDFRenderer.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to