Putting SVG in PDF with FOP works on Local Machine but not on Server - apache-fop

On the local machine everything works fine, when I try to run it on the server I get this error, it generates fine, but without the SVG logo included.
2019-07-12 09:09:01,956 [ERROR] [main] [LoggingEventListener] Image not available. URI: (instream-object). Reason: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for null (No context info available)
org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for null
at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:181)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingDocument(AbstractIFPainter.java:317)
at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:286)
Here is how it is included
<fo:block margin-right="1.5cm" text-align="right">
<fo:instream-foreign-object>
#include("Logo.vm")
</fo:instream-foreign-object>
</fo:block>
Here is the SVG Include File snippet Logo.vm:
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
id="Ebene_1"
x="0px"
y="0px"
viewBox="0 0 175 40"
enable-background="new 0 0 115 40"
xml:space="preserve"
inkscape:version="0.48.4 r9939"
width="146"
height="38"
sodipodi:docname="DL_115x40.svg"><metadata
id="metadata3067"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/d/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs3065" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="492"
inkscape:window-height="309"
id="namedview3063"
showgrid="false"
inkscape:zoom="2.7826087"
inkscape:cx="57.5"
inkscape:cy="20"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="0"
inkscape:current-layer="Ebene_1" />
<path class="st0" d="M122.9 34.2c0 .8-.6 1.3-1 .... *MORE AND MORE NUMBERS COMMING*

For me, this problem occurred when using Amazon Corretto JDK. Java Corretto has some bug that causes issues with fonts, see issues on the Github: Broken Font support (Fontconfig) in AWS-Lambda (java11) and Generic Linux distro requires Fontconfig for font support (java8)
What actually solved this issue for us was installing package fontconfig on the OS (we are running Ubuntu virtual servers, so no problem with that):
sudo apt-get install fontconfig
After that SVG renderring was OK.

Related

PHP Warning: Module 'imagick' already loaded in Unknown on line 0, need some assistance

So I checked my spam folder today and had 122 messages send through the server stating:
PHP Warning: Module 'imagick' already loaded in Unknown on line 0
Non stop it keeps sending me this.
Googled it and still have no clue on how to fix it as I need a step by step answer.
Found a similar question on stack but it's too complicated for me to understand.
I'm on the latest Plesk Onyx and OS=Ubuntu 16.04.6 LTS‬.
As I'm running php 7.3 I hoped when I uninstalled php 7.0 in plesk it would go away but unfortunately it didn't.
It's send from here
Cron <root#server> [ -x /usr/lib/php/sessionclean ] && /usr/lib/php/sessionclean
And after php --ini (read about it on a forum) this was the result:
PHP Warning: Module 'imagick' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File: /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed: /etc/php/7.0/cli/conf.d/00-ioncube-loader-7.0.ini,
/etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.0/cli/conf.d/10-opcache.ini,
/etc/php/7.0/cli/conf.d/10-pdo.ini,
/etc/php/7.0/cli/conf.d/15-xml.ini,
/etc/php/7.0/cli/conf.d/20-calendar.ini,
/etc/php/7.0/cli/conf.d/20-ctype.ini,
/etc/php/7.0/cli/conf.d/20-curl.ini,
/etc/php/7.0/cli/conf.d/20-dom.ini,
/etc/php/7.0/cli/conf.d/20-exif.ini,
/etc/php/7.0/cli/conf.d/20-fileinfo.ini,
/etc/php/7.0/cli/conf.d/20-ftp.ini,
/etc/php/7.0/cli/conf.d/20-gd.ini,
/etc/php/7.0/cli/conf.d/20-gettext.ini,
/etc/php/7.0/cli/conf.d/20-iconv.ini,
/etc/php/7.0/cli/conf.d/20-imagick.ini,
/etc/php/7.0/cli/conf.d/20-imap.ini,
/etc/php/7.0/cli/conf.d/20-json.ini,
/etc/php/7.0/cli/conf.d/20-mbstring.ini,
/etc/php/7.0/cli/conf.d/20-mysqli.ini,
/etc/php/7.0/cli/conf.d/20-pdo_mysql.ini,
/etc/php/7.0/cli/conf.d/20-pdo_sqlite.ini,
/etc/php/7.0/cli/conf.d/20-phar.ini,
/etc/php/7.0/cli/conf.d/20-posix.ini,
/etc/php/7.0/cli/conf.d/20-readline.ini,
/etc/php/7.0/cli/conf.d/20-shmop.ini,
/etc/php/7.0/cli/conf.d/20-simplexml.ini,
/etc/php/7.0/cli/conf.d/20-sockets.ini,
/etc/php/7.0/cli/conf.d/20-sqlite3.ini,
/etc/php/7.0/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.0/cli/conf.d/20-sysvsem.ini,
/etc/php/7.0/cli/conf.d/20-sysvshm.ini,
/etc/php/7.0/cli/conf.d/20-tokenizer.ini,
/etc/php/7.0/cli/conf.d/20-wddx.ini,
/etc/php/7.0/cli/conf.d/20-xmlreader.ini,
/etc/php/7.0/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.0/cli/conf.d/20-xsl.ini,
/etc/php/7.0/cli/conf.d/20-zip.ini,
/etc/php/7.0/cli/conf.d/zend_extensions_psa.ini
I already know it's probably easily fixed when you know linux but I'm learning on the go and posses very little knowledge yet.
Could anyone assist me with the right commands?
Cheers
Locate where is your php.ini file by:
php -i | grep Configuration
Configuration File (php.ini) Path => /usr/local/etc/php/7.4
Loaded Configuration File => /usr/local/etc/php/7.4/php.ini
Open the php.ini file and remove the line:
extension=imagick.so
or change the line to a comment:
; extension=imagick.so

TYPO3 EXT:webkitpdf does not render PDF file

Using EXT:webkitpdf with TYPO3 7.6 worked very well. But "suddenly" the PDFs were corrupted or no PDF file was written (just empty temp-files). There is also no entry in the EXT:webkitpdf-Log.
After some investitgation I found this in my TYPO3-error-Log:
10-02-17 12:49 - core: Core: Error handler (FE): PHP Warning: Cannot modify header information - headers already sent in /is/htdocs/wpXXXXXXXXX/www/typo3_sources/typo3_src-7.6.13/typo3/sysext/frontend/Classes/Utility/CompressionUtility.php line 54
Okay, it's the FE:compression!
After turning off [FE][compressionLevel]=0 in InstallTool, all works fine again!

fuseki load graph - s-put not found

I am trying to load a graph in fuseki. The server is working as it should.
But when I try s-put inside the fuseki folder it tells me s-put is not found?!
hdeus$ ls
DEPENDENCIES config.ttl s-delete
Data fuseki s-get
LICENSE fuseki-server s-head
NOTICE fuseki-server.bat s-post
ReleaseNotes.txt fuseki-server.jar s-put
config-examples.ttl fuseki_config.ttl s-query
config-inf-tdb.ttl log4j.properties s-update
config-tdb.ttl pages s-update-form
hdeus$ sudo ./s-put http://localhost:3030/ds/data default Data/books.ttl
sudo: ./s-put: command not found
Any idea what the problem might be? I tried copy/paste s-put from the ls output but stil nothing... I am working in mac os X
Is the file executable? If you unpacked from the zip file, you need to set the s-* executable. Also, you need ruby installed.

How to configure Perl/FCGI (FastCGI) with IIS 7.5?

I'm trying to get Perl/FastCGI (FCGI) running with IIS 7.5. The version of C:\Windows\System32\inetsrv\iisfcgi.dll is 7.5.7601.17514. Here's my web.config and my Perl script:
D:\MiLu\Dev :: more /t1 web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="true" />
<handlers>
<add name="FCGI" path="*.pl" verb="*"
modules="FastCgiModule"
scriptProcessor="C:\Opt\Cygwin\bin\perl.exe"
resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>
</configuration>
D:\MiLu\Dev :: more /t4 Perl\fcgi\count.pl
use strict;
use warnings;
use FCGI;
my $count = 0;
my $request = FCGI::Request();
while ( $request->Accept >= 0 ) {
print "Content-type: text/html\r\n\r\n", ++$count;
}
All I'm getting is a 500 with a generic error page from IIS stating "The FastCGI process exited unexpectedly" and listing possible error causes.
The script runs fine from the command line, printing its three lines and then exiting immediately, indicating that script and module installation are alright. (I copied it from the FCGI manual, by the way, so it should be okay.)
D:\MiLu\Dev :: C:\Opt\Cygwin\bin\perl.exe Perl\fcgi\count.pl
Content-type: text/html
1
There is an FCGI::IIS module, however, it appears to have worked only for IIS 5.1 and 6.0.
FastCGI and Perl - FastCGI with Perl on IIS 5.1, 6
IIS and FastCGI/Scripting languages/Perl
The fact that there is a dedicated FCGI module for IIS suggests that IIS 5.1 and 6.0 provided their own non-standard FCGI implementation. So if this were true, what about IIS 7.5 then? Quite a lot of uncertainties.
The author of FCGI::IIS seems to have tried to make his module work with IIS 7.0 (Getting Perl working on IIS7 with FastCGI - 2007), but given up.
Where can I find something more concrete as to what the error is? Is there a log file? What should I be looking for in the Windows event viewer (eventvwr)?
Is there some magic incantation for IIS that I'm missing?
There's not much information out there on this combination. But it might work, in the end. There is a FastCGI Application configuration reference page here, and someone has got Catalyst to work with FastCGI on IIS 7.0 (Catalyst+IIS 7.0 on MS Windows 2008/Vista).
I've not done this for a while, and never with Cygwin.
In order to test this could you please download and install the latest active state perl for your architecture and try installing/configuring as below:
http://legacy.websitepanel.net/kb/installing-and-running-active-perl-runtime-as-isapi-on-microsoft-iis-7.0
Another reference:
http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx
Good luck.
I've just come across this. A lot of the links you reference are mine. At the time I was writing those guide FastCGI for IIS was brand new, and the Vista version wasn't out yet. Unfortunately due to work I ended up on other projects and didn't get chance to continue with the guides once the Vista (IIS 7) version came out.
I've only just come to a project that needs this again, and in searching for a solution myself I came across your post. I've done some testing and managed to find a solution.
FastCGI works fundamentally differently on Windows to what it does on Linux. It's not just with the IIS version, but with the Apache version as well.
On Linux you can set FastCGI as the handler, and the shebang for the script will be enough to point it to Perl and do the right thing (as long as you've coded your script for FCGI or CGI::Fast).
On Windows you need to specify the FastCGI script you want to be invoked with the handler:
IIS 7:
IIS Manager -> Sites -> Web site -> Handler Mappings -> Add Module Mapping...
Request Path: test_script.fcgi
Module: FastCgiModule
Executable: c:\perl\bin\perl.exe|c:\inetpub\wwwroot\test_script.fcgi
Name: Test FCGI example
Click OK then select to add the FastCGI application. If you check the FastCGI settings for the server you'll need that the part after the | is set as the arguments to the executable (Perl).
Restart the server (not just the website). It should be working. Unfortunately, if you want to use this technique you'll need to add a mapping for each script. The FCGI::IIS module tried to work around this issue, but it has a lot of Caveats and isn't finished.
Apache
I tested this on WAMP by copying the mod_fcgid.so file to the appropriate directory, and updating httpd.conf:
<IfModule fcgid_module>
FcgidInitialEnv PATH "C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;C:/Perl/bin"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 64
FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 1
FcgidMaxRequestLen 8131072
<Files ~ "\test_script.fcgi$">
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .fcgi
FcgidWrapper "C:/Perl/bin/perl.exe c:/wamp/www/test_script.fcgi" .fcgi
</Files>
</IfModule>
I hope that helps anyone facing the same issues as you.
Lyle

setting ACLs for subfolders using Web Deploy package

I’m trying to build a Deployment Package in Visual Web Developer Express 2010 which sets the ACL for a subfolder of the deployed website. I used the following information http://leethams.wordpress.com/2010/06/12/modifying-directory-permissions-with-web-deployment/
This is my test:
Create a new blank ASP.NET Application (WebApplication2 in this example)
In advanced compilation options, change .NET Framework target version to 3.5
Create a new folder (Config in this example) and add any file inside the folder
Create a new file called WebApplication2.wpp.targets, with this content
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Extends the AfterAddIisSettingAndFileContentsToSourceManifest action do also set ACLs -->
<IncludeCustomACLs>TRUE</IncludeCustomACLs>
<AfterAddIisSettingAndFileContentsToSourceManifest Condition="'$(AfterAddIisSettingAndFileContentsToSourceManifest)'==''">
$(AfterAddIisSettingAndFileContentsToSourceManifest);
SetCustomACLs;
</AfterAddIisSettingAndFileContentsToSourceManifest>
</PropertyGroup>
<Target Name="SetCustomACLs" Condition="'$(IncludeCustomACLs)'=='TRUE'">
<Message Text="Adding Custom ACls" />
<ItemGroup>
<MsDeploySourceManifest Include="setAcl" Condition="$(IncludeSetAclProviderOnDestination)">
<setAclUser>anonymousAuthenticationUser</setAclUser>
<path>$(_MSDeployDirPath_FullPath)</path>
<setAclAccess>Read,Write</setAclAccess>
<setAclResourceType>Directory</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
</ItemGroup>
</Target>
</Project>
I execute from the command line and everything works fine:
-------------------------------------------------------
Start executing msdeploy.exe
-------------------------------------------------------
"C:\Program Files\IIS\Microsoft Web Deploy\\msdeploy.exe" -source:package='C:\T
emp\WebApplication2\WebApplication2\obj\Debug\Package\WebApplication2.zip' -dest
:auto,includeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:
ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\Temp\WebApp
lication2\WebApplication2\obj\Debug\Package\WebApplication2.SetParameters.xml"
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Número total de cambios: 3 (0 agregados, 0 eliminados, 3 actualizados, 0 parámet
ros cambiados, 0 bytes copiados)
Now, to set the permissions for the Config folder, I change the following line and rebuild the deployment package.
<path>$(_MSDeployDirPath_FullPath)/Config</path>
I get the following error:
-------------------------------------------------------
Start executing msdeploy.exe
-------------------------------------------------------
"C:\Program Files\IIS\Microsoft Web Deploy\\msdeploy.exe" -source:package='C:\T
emp\WebApplication2\WebApplication2\obj\Debug\Package\WebApplication2.zip' -dest
:auto,includeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:
ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\Temp\WebApp
lication2\WebApplication2\obj\Debug\Package\WebApplication2.SetParameters.xml"
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (C:\Temp\WebApplication2\WebApplication2\obj\Debug\Pac
kage\PackageTmp/Config).
Error: Se debe especificar un valor para 'setAclUser' cuando se usa el proveedor
'setAcl' con una ruta de acceso física.
Recuento de errores: 1.
In English it says: “Error: a value for ‘setAclUser’ must be specified when using the ‘setAcl’ provider with a physical path". Notice the third setAcl was changed to the physical path where the deployment package is located.
I then tried to modify it this way:
<AdditionalProviderSettings>setAclUser;setAclResourceType;setAclAccess</AdditionalProviderSettings>
But the error remains.
If I execute the deployment package with the “/t” switch, it does not throw the error, although it still shows the physical path.
I can hardcode the IIS path and change the line like this:
<path>Default Web Site/WebApplication2_deploy/Config</path>
It works fine. However, I wouldn’t like to do that, since the installation path need to be parameterized.
Changing the path to a backslassh makes no difference:
<path>Default Web Site/WebApplication2_deploy\Config</path>
Any help would be appreciated.
Thanks