Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top