0

我正在为一家报纸网站开发 CMS 模块。我让编辑可以选择上传.pdf整份报纸,然后将其转换成翻页数字在线报纸。

翻页技巧是用 flash 完成的,只是.swf我在所有版本中都使用的。我的问题是.pdf转换.jpg

这些.pdf是在 Adob​​e InDesign CS4 中完成的,并且大多数时候都包含具有阴影或斜角等效果的图像。

我最初用 s 尝试了我的代码,其中.pdf只有文本或简单的图像,它运行良好。当我尝试使用更复杂.pdf的 s(包括带有阴影效果的旋转图像)时,事情变得很棘手。

这是我的ghostscript代码:

$result=exec("gs -sDEVICE=jpeg -sOutputFile=../ediciones/20090717/pages/page-%d.jpeg ../ediciones/20090717/20090717.pdf");

这是您需要的唯一链接。

4

2 回答 2

1

I have the suspect that what gs does is to convert the pdf into the same datamodel that supports postscript. Postscript does not support transparency (alpha channel), so there's no way to represent the drop shadows in this intermediate format. Then, gs renders the jpg, obviously with no trasparencies.

I think you will have to use another strategy to convert your pdfs to jpg.

于 2009-07-30T17:18:38.667 回答
0

问题已解决。

它与从 Adob​​e InDesign CS4 导出 PDF 的方式有关。

此导出的正确格式是:

  • 标准:PDF/X-3:2003
  • 兼容性:Acrobat 4 (PDF 1.3)
  • 输出 - 颜色:无颜色转换
  • 输出 - PDF/X: Document --> (无论文档有什么空间)
  • 高级 - 透明度整平器:[中等分辨率]

其中一些配置我不知道它们是什么,但这是用于正确导出 PDF 并转换为 JPEG(包括阴影)的配置。

据我了解,使用这种配置,在生成 PDF 之前会发生一个展平过程,因此可以省去 Ghostscript 必须解释透明度的麻烦。

您现在可以在此处查看生成的 JPEG:http: //www.dengelz.com/clientes/norte/ediciones/20090717/pages/page-1.jpg

于 2009-07-30T19:31:01.207 回答