Greg Hains Posted May 24, 2019 Posted May 24, 2019 Good morning. I have a solution that generates a PDF from a series of tables, appending various pages to the report. Sending it via email is fine, even saving it to a fixed file location, but I am experiencing difficulty in being able to save it in a container field so the user should be able to click on it and view this PDF on the screen. How do I save this please? I don't get an error in the solution (or script debugger), it just doesn't appear in the field. Any suggestions please? Many thanks in advance too. Greg
[email protected] Posted May 24, 2019 Posted May 24, 2019 Hi Greg. Create a filepath variable, eg $fpath = get(temporarypath) & "mypdf.pdf" save the pdf to $fpath then use the script statement Insert PDF , using $fpath
Greg Hains Posted May 25, 2019 Author Posted May 25, 2019 Hi there, Thanks for getting back to me. Getting the PDF file to save to a disk location hasn't been a problem ($fpath), but inserting it into a container field is eluding me. Unless I'm doing something wrong, the Insert PDF command only allows a string to be entered - file path etc - not a [container] field to copy/move it to. What am I missing please? Greg
comment Posted May 25, 2019 Posted May 25, 2019 It's hard to tell what you're doing wrong when you don't show us exactly what you're doing. If you're using Insert PDF, then you must make sure that: your file path begins with image, imagemac, imagewin, or imagelinux; the target container field is the active layout object; the selected instance of the container field is optimized for PDF. For a scripted process like this, my preference would be to use Insert File, since it can work entirely at the data level.
Greg Hains Posted May 25, 2019 Author Posted May 25, 2019 Hi Comment, I never had a problem creating the PDF or where it went - that was all fine - yep, I use the correct file path. Target field was the active layout object too. What was not working was the actual Insert PDF command. Debugging gave me a File Missing (100) error on that step whether I used variables or fixed locations. I tried many combinations. I tried an Insert File instead and it worked fine first time. Thanks for that idea. I'm not sure why Insert PDF is not working, and I will follow this up later. Thank you for helping me get it working. Greg
[email protected] Posted May 27, 2019 Posted May 27, 2019 I agree with Comment - insert File a smarter idea. This fine spring Pacific Northwest weather must be throwi
Greg Hains Posted May 27, 2019 Author Posted May 27, 2019 Hi Iain, Looks like you got cutoff, but yes, the Insert File worked whereas Insert PDF did not. It's all happy now. Thank you to everybody who helped me. Greg
Recommended Posts
This topic is 2005 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now