[Windows] Not exporting SVG text element to PNG in IIS

Bug #1441998 reported by jmr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Version: Inkscape-0.91-1

Trying to export SVG to PNG using Inkscape command line from an ASP.NET MVC app. But in the PNG all the text elements of SVG are missing.

Debugging inkscape process showed that it is trying to access to WINDOWSFONTDIR which does not exists.
This name seems to be hardcoded in libfontconfig-1.dll

Indeed, if we change this to /Windows/Font in this lib using a binary editor, it does work.

It would be fine to fix this in the next release!

Thanks,
Jean-Michel

Tags: iis windows
Revision history for this message
Alvin Penner (apenner) wrote :

could you attach the exact command-line command you are using?

Revision history for this message
jmr (jmpalavas) wrote :

Hi,

Here are the arguments:
-z -f "D:/inetpub/wwwroot/frodon/cache/frodon6079_20150409_162057.svg" -e "D:/inetpub/wwwroot/frodon/cache/frodon6079_20150409_162057.png"

The hack to the lib does not work very well in fact. We get the texts but not the good font.
If we can run As Administrator, it is working.

Here is the dotnet code used to call inkscape:
                    Dim L_argument As String = " -z -f """ + Simbad_drive + "/inetpub/wwwroot/" + Serveur + "/cache/" + L_name_file + ".svg"" -e """ + Simbad_drive + "/inetpub/wwwroot/" + Serveur + "/cache/" + L_name_file + ".png"""
                    Dim p As System.Diagnostics.Process = Nothing
                    Dim processStartInfo As System.Diagnostics.ProcessStartInfo
                    processStartInfo = New System.Diagnostics.ProcessStartInfo()
                    processStartInfo.FileName = inkscape
                    processStartInfo.Arguments = L_argument
                    'processStartInfo.Verb = "runas"
                    processStartInfo.WorkingDirectory = "C:\Soft\"
                    processStartInfo.EnvironmentVariables("USERPROFILE") = Simbad_drive + "/inetpub/wwwroot/" + Serveur + "/cache/"
                    'processStartInfo.EnvironmentVariables("WINDOWSFONTDIR") = "C:\Windows\Fonts\"
                    processStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden
                    processStartInfo.UseShellExecute = False

                    processStartInfo.RedirectStandardError = False
                    p = System.Diagnostics.Process.Start(processStartInfo)

Revision history for this message
Alvin Penner (apenner) wrote :

thanks for the detailed info. When I run this command in DOS it appears to work normally, so it is presumably a security issue of some sort. It looks as if it will be necessary to run this test from IIS, which I am not in a position to be able to do.

just two questions of clarification:
- I see you are defining WINDOWSFONTDIR in software, is this working, or at least helping?

- the original post suggested that there was no text. The second post suggests that the font is wrong.
   Is the problem that you are not getting any text, or is the problem that you are getting the wrong font, like perhaps a default font instead of the one you requested?

Revision history for this message
jmr (jmpalavas) wrote : Re: [Bug 1441998] Re: [Windows] Not exporting SVG text element to PNG in IIS

Hi Alvin,

There is no text at all in the PNG. We got some text after manually
hacking the libfontconfig-1.dll
I thought this could give you a clue on the problem. Sorry that this
made some confusion instead.

Defining WINDOWSFONTDIR environment variable does not fix the problem.
Setting full access to everyone for the inkscape folder does not fix the
problem.

IIS asp is generally executed with user NETWORK SERVICE.

It seems that the text "WINDOWSFONTDIR" is harcoded in the dll i.e it
does not read the content of the environment variable but put this
string as is.

Regars,
Jean-Michel

Le 09/04/2015 20:07, Alvin Penner a écrit :
> thanks for the detailed info. When I run this command in DOS it appears
> to work normally, so it is presumably a security issue of some sort. It
> looks as if it will be necessary to run this test from IIS, which I am
> not in a position to be able to do.
>
> just two questions of clarification:
> - I see you are defining WINDOWSFONTDIR in software, is this working, or at least helping?
>
> - the original post suggested that there was no text. The second post suggests that the font is wrong.
> Is the problem that you are not getting any text, or is the problem that you are getting the wrong font, like perhaps a default font instead of the one you requested?
>

Revision history for this message
Alvin Penner (apenner) wrote :

thanks for the info. Unfortunately the fontconfig library is an external library not maintained by Inkscape. You may get more info at:
http://www.freedesktop.org/wiki/Software/fontconfig/
there is also a mailing list at:
http://lists.freedesktop.org/mailman/listinfo/fontconfig
it might be worthwhile to post a question there to see if you get a response.

Revision history for this message
Manpreet Singh (singh-manu89) wrote :

Hello Jean-Michel/ Admin

I am facing same issue with Text missing when deploying my .Net website to IIS. However i have followed your steps in editing the libfontconfig-1.dll file,

But after editing the file, The export to PDF process gets really slow, I am converting SVG to PDF.

If you can, Please send me your edited DLL file, So that i can replace and Test.

Thanks'

Manpreet

Revision history for this message
jmr (jmpalavas) wrote :

Hi Manpreet,

Unfortunately, our edited DLL was not working properly so we have
removed it.
We are no longer using this library. We have installed inkspace on our
web server.

Regards
Jean-Michel

Le 01/03/2016 08:26, Manpreet Singh a écrit :
> Hello Jean-Michel/ Admin
>
> I am facing same issue with Text missing when deploying my .Net website
> to IIS. However i have followed your steps in editing the
> libfontconfig-1.dll file,
>
> But after editing the file, The export to PDF process gets really slow,
> I am converting SVG to PDF.
>
> If you can, Please send me your edited DLL file, So that i can replace
> and Test.
>
> Thanks'
>
> Manpreet
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.