我可以使用fpdf库在pdf上显示图像时将图像分割到下一页吗?

我可以使用fpdf库在pdf上显示图像时将图像分割到下一页吗?

问题描述:

I am writing a code in php 5 to generate a pdf file which will have the images.I am displaying full length images.The image gets cut as soon as it reaches the end of the page(i.e. bottom of the pdf page).I want the image to continue being displayed from the next page.So that the complete images is visible even if it is larger than the size of the pdf page.Is it possible?If so please help!!

我正在编写一个代码在php 5中生成一个pdf文件,它将有图像。我正在显示全长 图像。一旦到达页面的末尾(即pdf页面的底部),图像就会被剪切。我希望图像从下一页继续显示。因此,即使图像较大,也可以看到完整的图像 比pdf页面的大小。有可能吗?如果有,请帮助!! p> div>

I'm not sure if it can be done using fdpf alone. The Image() function does not support partial images; so you need to find a way to split the image beforehand (using GD or something similar.)

In short, you need to find out how much of the image to print per page (ie. how high is the printable area of the PDF page, excluding header, footer etc.), and then create a temporary image consisting of the correct clipping of the image. This is what you add with the Image() function.

If using GD, here is how to copy a portion of an image into another image:

GD imagecopy() function