PDF from URL?

Hi. I have created a custom module and added a print PDF button to it and all is working fine.

Is there away i can access this pdf from a URL, for instanct somethig like http://ipaddress/index.php?module=cust_mod&action=pdf&templateid=1234546

Any Help would be great.

Version 7.10.9

Sugar Version 6.5.25 (Build 344)

Do you want this to require being logged in to SuiteCRM, or not? There are different ways to build entry points, according to this distinction.

Have a look at entrypoint=download links, like this one used for contacts photos:

http://10.0.0.200/index.php?entryPoint=download&id=71fa5dda-c199-9c97-560f-5bce43a4a459_photo&type=Contacts

I am not sure how generic the mechanism is, but this should allow you to grab a file from the upload directory and serve it.

thanks, this is not quite what i am after, The PDF doesn’t exsit, the print pdf funtion gernates the pdf then offers it as a download. So i need a link which will allow me to genertate the pdf then download it.

Cheers

Ah, then you want to make your own custom entry-point, just for this purpose, and in there you can call you code to generate and then save the file in the “upload” folder (or “public” folder if no login is to be required), and create an adequate “download” entry-point URL to send back.

Or you can put the actual PDF content directly as HTTP response, if that’s what you prefer.

See the Docs chapter for entry-points for help on creating a custom entry-point.