Re: [xep-support] Re: svg size parameters

From: Alexander Peshkov <peshkov@renderx.com>
Date: Thu Jun 16 2005 - 01:56:30 PDT

Hello Randy,

Your image is scaled with respect to its width. If your image is too
tall to fit into the page it will be dropped because of overflow.
That's why height/width ratio defines whatever image is visible or not
- all your images are scaled to have width match available space.
"Wide" images have relatively small height and their height is reduced
enough to make it fit into page. "Tall" images also scaled to have
required width, but they remains too tall to fit and thus disappear.

Best regards,
Alexander Peshkov mailto:peshkov@renderx.com
RenderX

RG> Hi,

RG> I have a foreign object svg which I am transcoding to PDF using XEP, but I'm
RG> running into a problem understanding how to size my svg to fit the paper
RG> width.The xep reference document has this comment:

RG> 1. "For an SVG image to be processed by XEP, it must have an intrinsic
RG> size. If height or width are expressed in percents, a viewBox attribute must
RG> be present: the intrinsic size is determined by the viewBox, assuming 1 user
RG> space unit = 1 pixel. Otherwise, the image cannot be used with XEP. "

RG> Here is the start of an example svg fo:block:

RG> .

RG> .

RG> <fo:block >

RG> <fo:instream-foreign-object content-width="scale-to-fit" width="100%">

RG> <svg:svg

RG> width="100%" height="100%"

RG> viewBox="17523842 -10290750.5 6746906 6112968.5"

RG> xmlns:xlink="http://www.w3.org/1999/xlink"

RG> xmlns:svg="http://www.w3.org/2000/svg"

>>

RG> .

RG> .

 

RG> This file formats without comment but does not show the svg in
RG> the resulting PDF file. Is this because viewBox width and height are used to
RG> determine "intrinsic size" and are too large relative to PDF paper size?

 

RG> If I make the following change to the svg width and height attributes, the
RG> pdf will show the svg map (note: my page master is set to size="landscape" :

RG> <svg:svg

RG> width="1000" height="650"

RG> viewBox="17523842 -10290750.5 6746906 6112968.5"

RG> xmlns:xlink="http://www.w3.org/1999/xlink"

RG> xmlns:svg="http://www.w3.org/2000/svg"

>>

 

 

RG> Now if I change to: width="1200" height="800" then the PDF
RG> file no longer shows my svg map. As long as I keep the height/width ratio
RG> <0.65 the svg will show in the PDF? However the viewbox appears to change
RG> with the use of different height/width ratios? Adding a
RG> preserveAspectRatio="xMinYMin" attribute to the svg element does not appear
RG> to affect the outcome.

 

RG> What is the relationship between the width and height attributes of the svg
RG> element and visibility in the pdf ?

 

RG> Is there something in the xep docs that I've missed?

 

RG> Thanks

RG> Randy

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Thu Jun 16 02:26:29 2005

This archive was generated by hypermail 2.1.8 : Thu Jun 16 2005 - 02:26:30 PDT