← Prev in month ← Prev in thread
Next in thread → Next in month →

Generating SVG in PDF

From
Xmplar <>
Date
2012-11-01T06:08:01+00:00
ID
Thread
Generating SVG in PDF
X-NONE
  X-NONE
  
   
   
   
   
   
   
   
   
   
   
   
  
  
   
   
   
   
   
   
   
   
   
   
   
  

    
Has anyone managed to produce PDFs with SVG
      files? I can
      only achieve this with fo:instream-foreign-object, even though it
      is apparently
      possible to use fo:external-graphic 
      to
      refer to an external SVG (see “SVG Essentials”, O’Reilly). Using
      fo:external-graphic (or even background-image in fo:block) just
      gives me a
      little box with red cross and the SVG is not generated.
    

    
I’m using XEP 4.21, Saxon 6.5.5.

    
The markup that works is:

    
<fo:block xmlns:ex="http://www.renderx.com/XSL/Extensions"

              xmlns:xi="http://www.w3.org/2001/XInclude" span="all" background-color="#cc9933"

              border-top="1pt solid
        #ff0000"
        border-bottom="1pt solid
        #ff0000"

              border-left="0pt none
        #000000"
        border-right="0pt none
        #000000"
        margin-top="0mm"

              margin-bottom="3mm" margin-left="0mm" margin-right="0mm" padding-top="3mm"

              padding-bottom="3mm" padding-left="3mm" padding-right="3mm" background-repeat="no-repeat"

              background-image="url(images/Figure5-4.gif)" ex:background-content-width="170mm"

             
        background-position="50% 50%"><fo:instream-foreign-object><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"

                   width="193.26px" height="163.26px" viewBox="0 0 193.26 163.26"
        enable-background="new 0 0 193.26 163.26"
        xml:space="preserve" transform="translate(0,100)">

      <rect x="0.63" y="0.63" fill="#ffffff" fill-opacity="0.7" stroke="#000000" stroke-width="0.5" width="192" height="162"/>

      </svg></fo:instream-foreign-object><fo:block
        ….

    
    
-- 

      Dave Gardiner
← Prev in month ← Prev in thread
Next in thread → Next in month →