Re: SVG styles being ignored

2019-09-11 Thread Thomas Radtke
And btw., Batik needs attributes width and height beside viewport in the 
svg root element. I noticed this when an recently uploaded SVG rendered 
correctly everywhere except in FOP generated PDFs. What happened was 
that Illustrator CC apparently stopped writing both arguments. Touching 
the file with Inkscape didn't help as it refused to add them.


Currently I always have to enter those values myself and actually are 
thinking about adding an xslt script to my CMS to add width and height 
after uploading SVGs :-(.


Best regards,

Thomas

Am 11.09.2019 um 23:41 schrieb Oskar Berggren:

Batik bug since 2015:
https://issues.apache.org/jira/browse/BATIK-1112

Sometimes coincidences are ridiculous... I discovered the existence of 
this problem only yesterday and tried to bring some attention to it:

http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-dev/201909.mbox/%3CCAHOuc7PL0%2Be-8H5Ahagm5q7ChSk%3DX6zsFMgs8gwot5-gHONKJQ%40mail.gmail.com%3E


Den ons 11 sep. 2019 kl 21:09 skrev Samuel Penn >:


Hi all,

I have a document which imports an SVG as a full page graphic. It
used to display fine, but recently I started having problems with
it. The problems started after I recently edited the image in
Inkscape (it's been unchanged for a couple of years). Since the
image was created in Inkscape, and has only ever been edited in
Inkscape, I'm not sure why it's started having problems now.

I'm using FOP 2.3 on Ubuntu 18.04, with Java 11.0.4

The first issue was that the image was displayed at the wrong size
- it was resized so only the top left quarter of the image was
displayed (but sized to fill the entire page). I've tracked this
down to a change in how Inkscape is setting the page width and
height in the document. It used to specify (according to my gitlab
history):
    width="744.09448819"
    height="1052.3622047"
Inkscape recently changed things to:
    width="210mm"
    height="297mm"

Since it's an A4 page (210mm x 297mm), the change seems perfectly
reasonable, but FOP doesn't seem to like it. Changing the units
back to the unitless values seems to have fixed that, so this
issue is more a curiosity than a problem for me at the moment.

The bigger issue is that FOP has stopped rendering styles on some
graphics. This seems to be mostly limited to text styles - colours
and border styles. Even if I convert the text to a path, then it
is still displayed as flat colour. I've put some examples of the
problem I'm seeing, along with a cut down FO file, here:

https://drive.google.com/open?id=1gFt4qC-30GA1VapKicCvTDjrbbiE093e

with-styles.png shows how the image should look (and does look in
Inkscape)
no-styles.png shows how the image is rendered by FOP when it's
converted to a PDF.

I've also included the SVG file, generated PDF and my fop.conf file.
The SVG includes the font Archivo Black (which is referenced in
the fop.conf), but I see the problem with standard fonts as well.

Also included, is test-wrong-size.pdf, which shows how the PDF is
rendered before I changed the page units from mm.

So far the only work around I've found is to export the image as
PNG from Inkscape, and include that in the document instead. I'd
prefer to be able to directly include the SVG though.

Thanks.

-- 
Sam.

https://www.notasnark.net/





--

Mit freundlichen Grüßen / with best regards

i.A. Dr. Thomas Radtke

Technische Redaktion / Technical Writer

Dr. Thomas Radtke
Fon +49 (0) 4498 8964
Fax +49 (0) 4498 687
thomas.rad...@hansa-klima.de

HANSA Klimasysteme GmbH
Stockweg 19
26683 Saterland (Germany)
www.hansa-klima.de

Geschäftsführer: Rolf Neumann, Jan Neumann, Carsten Fenne
Registergericht Oldenburg, HRB 151863




Re: SVG styles being ignored

2019-09-11 Thread Oskar Berggren
Batik bug since 2015:
https://issues.apache.org/jira/browse/BATIK-1112

Sometimes coincidences are ridiculous... I discovered the existence of this
problem only yesterday and tried to bring some attention to it:
http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-dev/201909.mbox/%3CCAHOuc7PL0%2Be-8H5Ahagm5q7ChSk%3DX6zsFMgs8gwot5-gHONKJQ%40mail.gmail.com%3E


Den ons 11 sep. 2019 kl 21:09 skrev Samuel Penn :

> Hi all,
>
> I have a document which imports an SVG as a full page graphic. It used to
> display fine, but recently I started having problems with it. The problems
> started after I recently edited the image in Inkscape (it's been unchanged
> for a couple of years). Since the image was created in Inkscape, and has
> only ever been edited in Inkscape, I'm not sure why it's started having
> problems now.
>
> I'm using FOP 2.3 on Ubuntu 18.04, with Java 11.0.4
>
> The first issue was that the image was displayed at the wrong size - it
> was resized so only the top left quarter of the image was displayed (but
> sized to fill the entire page). I've tracked this down to a change in how
> Inkscape is setting the page width and height in the document. It used to
> specify (according to my gitlab history):
> width="744.09448819"
> height="1052.3622047"
> Inkscape recently changed things to:
> width="210mm"
> height="297mm"
>
> Since it's an A4 page (210mm x 297mm), the change seems perfectly
> reasonable, but FOP doesn't seem to like it. Changing the units back to the
> unitless values seems to have fixed that, so this issue is more a curiosity
> than a problem for me at the moment.
>
> The bigger issue is that FOP has stopped rendering styles on some
> graphics. This seems to be mostly limited to text styles - colours and
> border styles. Even if I convert the text to a path, then it is still
> displayed as flat colour. I've put some examples of the problem I'm seeing,
> along with a cut down FO file, here:
>
> https://drive.google.com/open?id=1gFt4qC-30GA1VapKicCvTDjrbbiE093e
>
> with-styles.png shows how the image should look (and does look in Inkscape)
> no-styles.png shows how the image is rendered by FOP when it's converted
> to a PDF.
>
> I've also included the SVG file, generated PDF and my fop.conf file.
> The SVG includes the font Archivo Black (which is referenced in the
> fop.conf), but I see the problem with standard fonts as well.
>
> Also included, is test-wrong-size.pdf, which shows how the PDF is rendered
> before I changed the page units from mm.
>
> So far the only work around I've found is to export the image as PNG from
> Inkscape, and include that in the document instead. I'd prefer to be able
> to directly include the SVG though.
>
> Thanks.
>
> --
> Sam.
> https://www.notasnark.net/
>
>
>
>


SVG styles being ignored

2019-09-11 Thread Samuel Penn
Hi all,

I have a document which imports an SVG as a full page graphic. It used to 
display fine, but recently I started having problems with it. The problems 
started after I recently edited the image in Inkscape (it's been unchanged for 
a couple of years). Since the image was created in Inkscape, and has only ever 
been edited in Inkscape, I'm not sure why it's started having problems now.

I'm using FOP 2.3 on Ubuntu 18.04, with Java 11.0.4

The first issue was that the image was displayed at the wrong size - it was 
resized so only the top left quarter of the image was displayed (but sized to 
fill the entire page). I've tracked this down to a change in how Inkscape is 
setting the page width and height in the document. It used to specify 
(according to my gitlab history):
width="744.09448819"
height="1052.3622047"
Inkscape recently changed things to:
width="210mm"
height="297mm"

Since it's an A4 page (210mm x 297mm), the change seems perfectly reasonable, 
but FOP doesn't seem to like it. Changing the units back to the unitless values 
seems to have fixed that, so this issue is more a curiosity than a problem for 
me at the moment.

The bigger issue is that FOP has stopped rendering styles on some graphics. 
This seems to be mostly limited to text styles - colours and border styles. 
Even if I convert the text to a path, then it is still displayed as flat 
colour. I've put some examples of the problem I'm seeing, along with a cut down 
FO file, here:

https://drive.google.com/open?id=1gFt4qC-30GA1VapKicCvTDjrbbiE093e

with-styles.png shows how the image should look (and does look in Inkscape)
no-styles.png shows how the image is rendered by FOP when it's converted to a 
PDF.

I've also included the SVG file, generated PDF and my fop.conf file.
The SVG includes the font Archivo Black (which is referenced in the fop.conf), 
but I see the problem with standard fonts as well.

Also included, is test-wrong-size.pdf, which shows how the PDF is rendered 
before I changed the page units from mm.

So far the only work around I've found is to export the image as PNG from 
Inkscape, and include that in the document instead. I'd prefer to be able to 
directly include the SVG though.

Thanks.

--
Sam.
https://www.notasnark.net/