This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Generating PDF of Referring URL

mikee88 wrote on 2013-02-14:
I have a test example where I got the API working using PHP. However, what I want is to to put a link in a dynamic page template to generate PDFs of those pages (just like the type of link you guys offer for free).

My initial thoughts were that I should use my working example, but find a way to get the referral URL working like this: $pdf = $client->convertURI('referralurlhere'); but I don't know how to do that nor am I sure if that's the best way. Let me know what you think is the best way. I'm simply using the code below "getting started on this page:

support wrote on 2013-02-15:

Use this to build the current URL:
$url = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["PHP_SELF"];

I recommend you to take a look at this tutorial. It contains the "Provide a PDF version of your web pages" section which provides an example code.
mikee88 wrote on 2013-02-18:
Great, thanks!