How to generate PDF using flex with php.Currentely am using amfphp to do this.But it takes more time to generate.please guide me if anyone know the solution.

Dani AI

Generated

Given you mention AMFPHP with Flex, the usual case is an Adobe Flex client calling a PHP gateway. AMFPHP is a binary AMF remoting layer that is great for structured data but can add latency when you try to push large prebuilt PDFs end-to-end. A practical pattern is to keep AMF for data/control and let the server generate the PDF and expose it over HTTP for download — that avoids AMF serialization of large binary blobs and keeps the heavy work off the client. (amfphp.org)

For server-side generation, choose a tool that fits your templates and fidelity needs. Pure-PHP libraries such as TCPDF, mPDF and dompdf integrate directly into PHP apps and work well for many invoice/report use cases. For complex CSS or pixel-perfect print output, a headless renderer like wkhtmltopdf (or a headless Chromium workflow) usually produces more accurate results and can be faster for heavy HTML/CSS pages. (tcpdf.org)

Integration tips you can apply immediately: send only structured data from Flex, have PHP render the template or call the PDF library, save the file to a temp location, and return a small response with a download URL (or a job id if you queue the job). Cache frequently requested PDFs, use background jobs for slow reports, and profile the server (DB, template rendering, library CPU/memory) to find the real bottleneck. As indicated, server-side conversion is the right direction; and as noted, clarify which “Flex” you mean — if you really meant the lexical tool, the workflow would be different.

Recommended Answers

All 2 Replies

If you have control over the server, you could do something like php->latex->pdf.

Flex is a lexical analyzer. I suppose you could use it to convert php to pdf, but why? It is a totally inappropriate tool for the job. Most programming editors that can handle php can also generate (write) pdf documents from that text.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.