Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed code style, added extension.xml and added README.md
- Loading branch information
thiagocamposviana
committed
Apr 7, 2015
1 parent
b2e845c
commit cd9b961
Showing
5 changed files
with
158 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
Mugo wkhtmltopdf | ||
================ | ||
|
||
Installation | ||
------------ | ||
|
||
1) Extract the contents under the extension/ directory of your | ||
eZ Publish installation and activate it for all siteaccesses. | ||
2) Regenerate the autoloads array | ||
|
||
You can test it by accessing http://siteURL/wkhtmltopdf/node/2 | ||
|
||
Note: | ||
|
||
The extension in the SiteURL site.ini setting to generate the pdf. | ||
|
||
Installing wkhtmltopdf on CentOS | ||
-------------------------------- | ||
|
||
yum install fontconfig libXrender libXext xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi freetype libpng zlib libjpeg-turbo openssl | ||
wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.2.1/wkhtmltox-0.12.2.1_linux-centos6-amd64.rpm | ||
rpm -ivh wkhtmltox-0.12.2.1_linux-centos6-amd64.rpm | ||
ln -s /usr/local/bin/wkhtmltopdf /usr/bin/ | ||
|
||
If SELinux is running, this must be enabled or wkhtmltopdf will segfault: setsebool -P httpd_execmem 1 | ||
|
||
Install this file at /etc/fonts/conf.d/10-wkhtmltopdf.conf to improve text quality | ||
|
||
|
||
<?xml version='1.0'?> | ||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | ||
<!-- Improve kerning and spacing for wkhtmltopdf as per https://github.com/wkhtmltopdf/wkhtmltopdf/issues/45#issuecomment-53485578 --> | ||
<fontconfig> | ||
<match target="font"> | ||
<edit mode="assign" name="rgba"> | ||
<const>rgb</const> | ||
</edit> | ||
</match> | ||
<match target="font"> | ||
<edit mode="assign" name="hinting"> | ||
<bool>true</bool> | ||
</edit> | ||
</match> | ||
<match target="font"> | ||
<edit mode="assign" name="hintstyle"> | ||
<const>hintslight</const> | ||
</edit> | ||
</match> | ||
<match target="font"> | ||
<edit mode="assign" name="antialias"> | ||
<bool>true</bool> | ||
</edit> | ||
</match> | ||
<match target="font"> | ||
<edit mode="assign" name="lcdfilter"> | ||
<const>lcddefault</const> | ||
</edit> | ||
</match> | ||
</fontconfig> | ||
|
||
|
||
- | ||
We need to use high resolutions images, we can also improve the quality by changing the transparent to a solid color: | ||
|
||
image.ini.append.php | ||
|
||
|
||
[ImageMagick] | ||
... | ||
Filters[]=background=-background %1 | ||
Filters[]=flatten=-flatten | ||
... | ||
[sample_pdf_image] | ||
Filters[] | ||
Filters[]=background=#eee | ||
Filters[]=flatten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<software> | ||
<metadata> | ||
<name><a href="http://www.mugo.ca">Mugo wkhtmltopdf</a></name> | ||
<version>1.0</version> | ||
<copyright>Copyright (C) 2013 <a href="http://www.mugo.ca">Mugo Web</a></copyright> | ||
<license>GNU General Public License v2.0</license> | ||
<software/> | ||
This comment has been minimized.
Sorry, something went wrong. |
||
</metadata> | ||
|
||
<dependencies/> | ||
</software> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We think it would be better if you documented that the dependent library you are including within this extension is MIT licensed. eZJsCore provides a solid example of how to do this, https://github.com/ezsystems/ezpublish-legacy/blob/master/extension/ezjscore/extension.xml#L10