0

我有一个包含 50 个 jpeg、72 dpi、RGB、大小不一的目录。

我想创建一个 50 页的 PDF 8x10,每个图像在任一方向上最大 7x9,72dpi,RGB。然后是 .epub,然后是 .mobi。

我想创建第二个 50 页 PDF,8x6,现在每个图像在任一方向上最大 7x5,300dpi,CMYK,逆时针旋转 90(-90?)。

自 2007 年以来,我在 PS、ID、Acrobat 等领域手工完成了 200 次。每次完成 3-4 小时。我很好奇如何设计一个 PHP 脚本来做到这一点。我使用 PHP GD 来操作网页的 jpeg(裁剪和调整大小),但没有创建多页 PDF。

我在想自 2007 年以来所有这些都已经发展了一点,我应该能够在 PHP 中做到这一点。

4

3 回答 3

1

Welcome to StackOverflow!

If you know exactly what you want to do with your content, the most useful StackOverflow answers will come in response to code that you have written that implements some of what you're looking for.

For PDF generation, check out TCPDF, especially its examples. Multiple examples show you how to make multi-page documents. Example number 9 embeds an image on the page, and number 51 uses an image as a page background. TCPDF is roughly equivalent to FPDF, with a few more features and ongoing development.

For the epub and mobi formats, you'll need completely different tools.

There is a format convertor project on Github, but I haven't used it. It leverages other tools, like the ones below:

I know of one project that is a pure-PHP solution for generating epub content. And phpMobi seems to be an option for .mobi files.

于 2012-07-10T20:21:03.830 回答
1

如果你想使用 PHP,有一个很棒的开源类:FPDF。看看 - 手册比我解释得更好。

于 2012-07-10T20:02:23.397 回答
0

我打算休息一下吃午饭,但到目前为止,我发现 TCPDF 很有趣。

挑选其中一个示例,我没有找到以下文档来更改固定变量:

$pdf->Image('tcpdf/images/image_demo.jpg', 15, 140, 75, 113, 'JPG', 'http://www.tcpdf.org', '', true, 150, '', false, false, 1, false, false, false);

是否有参考数字的顺序和真/假的含义?

于 2012-07-11T11:02:45.870 回答