mjlongo Posted February 1, 2018 Share Posted February 1, 2018 I'm using the following code to return an inline graphic: return CreateResource(Field("name") + ".pdf", "graphic"); It works fine. However, the customer did not supply every file necessary. When the file does not exist, I instead want to simply return the name field using an appropriate font. So my question is pretty simple, how do you check that the graphic file indeed exists and if not, run a different set of code? Thanks! Quote Link to comment Share on other sites More sharing options...
ScottHillock Posted February 6, 2018 Share Posted February 6, 2018 I would do this by creating a text frame set on top of a graphic frame and use this: Pic = CreateResource(Field("name") + ".pdf", "graphic", true); if (Pic.exists){ FindTextFrame("Text").suppress = true; return Pic; } else{ FindGraphicFrame("Image").suppress = true; return CreateResource(""); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.