开发者

Need to modify link target within PDF based on operating system

We have an "application" consisting of a large number of PDF files that link to each other.

Some of the PDF files hav开发者_开发技巧e links that must be a web URL when running on a PC (or a Mac) but need to open a specific application when running on an iPad.

When not on the iPad, the links look like "http://10.85.1.102".

When on the iPad, they look like "netcam4://2" - which opens the NetCam4 application with camera 2 selected.

NOTE: this is already working but we have to create two versions of the PDF and it would be much better to have only one.

Is there a way using JavaScript (or ActionScript or whatever) for the PDF to determine in which OS it is being displayed and modify the link appropriately?

We don't care if this decision is made when loading the PDF or when the link is clicked.

By the way, so far we have found that GoodReader on the iPad is the only PDF viewer that will properly follow links - including those to the NetCam4 app.


Not really. PDF is generally run through a browser plugin and shouldn't have script running inside of it.

On the other hand, if you are serving these files up over http, you might be able to modify the contents of the PDF based on how they are compressed and what language you have on the server. PHP has PDFLib, for example, as well as Zend_PDF

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜