简体   繁体   中英

PHP: PDF Generation

I am currently working on a website. Basically when a user searches for something, i should be able to generate the pdf for the each of the search result item. I know one option of fpdf.

Is there something easier than fpdf or some service like if i send the url of my search result page, it sends back the generated pdf to me.

What is the easiest way to do this, what is the easiest option for this?

Thanks

Have you looked at the Zend Pdf class ?

There are a number of ways to generate pdf by using php, but i still think you will need to generate the whole pdf based on the data you want in to add to the pdf. But if you create some good helper classes, you should be able to create the wanted effect!

There is a service called pdfonfly That could do what you want, but you need to check if they provide an api to hook up your results!

PDF is a plain-text format, very easy to generate from code. (Usually it is compressed however fundamentally it is plain text.)

The basics are very simple, like high school algebra. You have a plane and an origin. And you draw points or lines at coordinates. Of course you also place text at a coordinate with a built-in font.

So, if your needs are very simple, you could pretty easily read the freely-available PDF spec and generate whatever you need—not ideal for all situations but it's easier than you think.

I worked with the FPDF library some time ago. It's entirely written in PHP and requires no installation at all. Just include it and you're ready to go.

The generation of PDFs is pretty simple with it, too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM