English 中文(简体)
Export to pdf on the client or server side?
原标题:

My client side application is using jqgrid that requests the server side, which in its turn queries MySQL and sends back the resultSet in XML format.

I m willing to add the export to PDF functionality in the client side And I was stumped on how to go about it.

Please any indications?

最佳回答

The export to pdf should be done on the server side. For something to be done on the client side, first the software to do it must exist there and then you should have permissions to use it. Browsers can t export to pdf by default. What you can do is have a link that sends the request to a page, which generates the needed data, exports it to pdf and writes it out. Something code like this would exist on that page (assuming you are using PHP as the server side language):

// We ll be outputting a PDF
header( Content-type: application/pdf );

// It will be called downloaded.pdf
header( Content-Disposition: attachment; filename="downloaded.pdf" );

// Code to create the pdf goes here...

// The PDF source is in original.pdf
readfile( original.pdf );

Source for above: http://php.net/manual/en/function.header.php

问题回答

暂无回答




相关问题
Export to pdf on the client or server side?

My client side application is using jqgrid that requests the server side, which in its turn queries MySQL and sends back the resultSet in XML format. I m willing to add the export to PDF ...

Image generator

I d like to be able to generate an image with overlaying text (that is inputted by the user) such as how it is done on www.depressiondog.info. Can someone show/link me to some code that will do that. ...

Where should I put this configuration setting?

I m designing a fairly small web application which will run on a Sun application server (v9.1). It only has a few pages, no database of its own, and will retrieve/update data via web services. There s ...

服务器面与用户对用户的MVC在网络信号中

我最近找到了一种与《伙伴关系协定》有关的有趣的替代办法。 NET MVC,我目前做的是:静态超文本,配有先进的 Java本式服务电话(大多数例子使用开放式雷达)。 例如,见此或......。

MySQL Users and All Privileges

Ok, I m trying to add a user to a MySQL database. This user should be able to add other users to the database it has privileges for. So I did this: GRANT ALL privileges ON thedbname.* TO topuser @ % ...

Doesn t get into Debug Mode

When I Press F5 on my VS2005 to debug the application, it launches the web app window but it is coming out of debug mode. When I tried to trace the Error in the EventViewer, this was the error: ...

热门标签