PDFBox:

We are using PDFBox (3.0.3) and Batik (1.18) to render PDF files to SVG, with 
great success.  However, we have found that a text 'highlight' is rendered as 
stroked text, and an image overlay.  Which is fine, except the <img> element 
for the highlight is defined without a transparency attribute, and thus 
obscures the underlying text.

I've attached a simple PDF test case, along with the rendered SVG result.  If I 
add opacity="0.40" to the <img> element, it will display properly.

If we render this same PDF to JPG, the result is correct, with the text showing 
on top of the highlight, so it would appear that the render code does know that 
the image should be non-opaque?

Any suggestions as to how to handle this?  What PDFBox call is handling the 
image rendering?  I've already derived a sub-class from the SVGGraphics2d 
object to handle other issues?

Rich Stafford
Chief Scientist
eQuorum Corporation
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
          'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg xmlns:xlink="http://www.w3.org/1999/xlink"; style="fill-opacity:1; 
color-rendering:auto; color-interpolation:auto; text-rendering:auto; 
stroke:black; stroke-linecap:square; stroke-miterlimit:10; 
shape-rendering:auto; stroke-opacity:1; fill:black; stroke-dasharray:none; 
font-weight:normal; stroke-width:1; font-family:'Dialog'; font-style:normal; 
stroke-linejoin:miter; font-size:12px; stroke-dashoffset:0; 
image-rendering:auto;" xmlns="http://www.w3.org/2000/svg";
><!--Generated by the Batik Graphics2D SVG Generator--><defs id="genericDefs"
  /><g
  ><defs id="defs1"
    ><clipPath clipPathUnits="userSpaceOnUse" 
id="clipPathb281a4c2-42e4-4fcb-9264-c5b61f626dbb1"
      ><path d="M0 0 L0 792 L612 792 L612 0 Z"
      /></clipPath
      ><clipPath clipPathUnits="userSpaceOnUse" 
id="clipPathb281a4c2-42e4-4fcb-9264-c5b61f626dbb2"
      ><path d="M-0 53.125 L-0 -0 L28.225 -0 L28.225 53.125 Z"
      /></clipPath
    ></defs
    ><g style="fill:rgb(0,0,0); fill-opacity:0; stroke-opacity:0; 
stroke:rgb(0,0,0);" transform="scale(4.1667,4.1667)"
    ><rect x="0" width="612" height="792" y="0" style="stroke:none;"
    /></g
    ><g style="text-rendering:optimizeLegibility; 
color-rendering:optimizeQuality; color-interpolation:linearRGB; 
image-rendering:optimizeQuality;" transform="scale(4.1667,4.1667) 
translate(0,792) scale(1,-1)"
    ><path d="M74.0396 708.7523 Q74.0396 708.7054 74.0162 708.6703 Q73.9928 
708.6351 73.9342 708.6176 Q73.8756 708.5941 73.7818 708.5824 Q73.6822 708.5648 
73.5357 708.5648 Q73.3951 708.5648 73.2955 708.5765 Q73.1959 708.5941 73.1373 
708.6117 Q73.0787 708.6351 73.0553 708.6703 Q73.0318 708.7054 73.0318 708.7523 
L73.0318 716.0297 Q73.0318 716.0765 73.0553 716.1117 Q73.0845 716.1469 73.1431 
716.1644 Q73.2076 716.1879 73.3013 716.1996 Q73.401 716.2172 73.5357 716.2172 
Q73.6822 716.2172 73.776 716.2054 Q73.8756 716.1879 73.9342 716.1703 Q73.9928 
716.1469 74.0162 716.1117 Q74.0396 716.0765 74.0396 716.0297 L74.0396 708.7523 
Z" style="stroke:none; 
clip-path:url(#clipPathb281a4c2-42e4-4fcb-9264-c5b61f626dbb1);"
      /><path d="M77.0396 708.7523 Q77.0396 708.7054 77.0162 708.6703 Q76.9928 
708.6351 76.9342 708.6176 Q76.8756 708.5941 76.7818 708.5824 Q76.6822 708.5648 
76.5357 708.5648 Q76.3951 708.5648 76.2955 708.5765 Q76.1959 708.5941 76.1373 
708.6117 Q76.0787 708.6351 76.0553 708.6703 Q76.0318 708.7054 76.0318 708.7523 
L76.0318 716.0297 Q76.0318 716.0765 76.0553 716.1117 Q76.0845 716.1469 76.1431 
716.1644 Q76.2076 716.1879 76.3013 716.1996 Q76.401 716.2172 76.5357 716.2172 
Q76.6822 716.2172 76.776 716.2054 Q76.8756 716.1879 76.9342 716.1703 Q76.9928 
716.1469 77.0162 716.1117 Q77.0396 716.0765 77.0396 716.0297 L77.0396 708.7523 
Z" style="clip-path:url(#clipPathb281a4c2-42e4-4fcb-9264-c5b61f626dbb1); 
stroke:none;"
    />
</g>
<g style="text-rendering:optimizeLegibility; color-rendering:optimizeQuality; 
color-interpolation:linearRGB; image-rendering:optimizeQuality;" 
transform="translate(298.5375,308.4376)">
<image x="0" y="0" width="29" 
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAA2CAYAAAA7+JL6AAAAWElEQVR4Xu3NsQ0A
IBCAwJ/V/XfQnhpjISTUN/NVe82+Pc1QdZqh6jRD1WmGqtMMVacZqk4zVJ1mqDrN
UHWaoeo0Q9VphqrTDFWnGapOM1SdZqg6zTfoFx2575lmkuwv5AAAAABJRU5ErkJg
gg==" style="clip-path:url(#clipPathb281a4c2-42e4-4fcb-9264-c5b61f626dbb2);" 
height="54" preserveAspectRatio="none"
/>
</g>
</g>
</svg
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to