【问题标题】:PDF Graphical Issues In Windows 8 Reader for Prawn-generated PDF虾生成的 PDF 在 Windows 8 阅读器中的 PDF 图形问题
【发布时间】:2013-12-24 03:31:48
【问题描述】:

我有一个使用 Prawn 生成 PDF 的 Rails 应用程序。

有一些rounded_rectangle 声明可以在 Adob​​e Reader 中正确呈现,但在 Windows 8 的 Reader 中则不然。在 Windows Reader 中,这些元素根本不会显示。唯一损坏的元素是 rounded_rectangles。

我的一些大虾代码:

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

在 Adob​​e Reader 中效果很好。

【问题讨论】:

    标签: ruby pdf windows-8 pdf-generation prawn


    【解决方案1】:

    我正在使用

    嵌入图像作为背景图像
    pdf.bounding_box([0, height], :width => width) do
      pdf.image background, :fit => [width, height]
    end
    

    但由于某种原因,这会导致任何图形落入该图像下方的图层中。使用图像作为背景或不将其放入边界框即可解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多