Domanda

I have a Rails application that generates PDF using Prawn.

There are some rounded_rectangle declarations that render correctly in Adobe Reader but not Windows 8's Reader. In Windows Reader, these elements simply aren't displayed. The only broken elements are the rounded_rectangles.

Some of my Prawn code:

pdf.stroke do
  pdf.rounded_rectangle [box_left, box_top], box_width, box_height, box_radius
end

which works great in Adobe Reader.

È stato utile?

Soluzione

I was embedding an image as the background image using

pdf.bounding_box([0, height], :width => width) do
  pdf.image background, :fit => [width, height]
end

but for some reason this caused any graphics to fall in a layer underneath this image. Using the image as a background or simply not putting it in the bounding box resolved the issue.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top