Printing Partners Posted February 21, 2018 Share Posted February 21, 2018 Other than the UserGuide.pdf, TagsRefGuide.pdf, and RulesSystemGuide.pdf that are links in FusionPro, are there other references I can use to learn more about the scripting environment (other than this portal)? I am trying to create an OnRecordStart script and I am looking for more information than the above guides provide on the PDFBoundingBox. Thanks Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 21, 2018 Share Posted February 21, 2018 This forum is probably the best place to learn. What specifically did you want to know about the PDFBoundingBox property? That defines which bounding box of a PDF resource is used for the graphic. It generally matters only if the PDF actually has bleed. Quote Link to comment Share on other sites More sharing options...
Printing Partners Posted February 21, 2018 Author Share Posted February 21, 2018 Dan, I have a template where the User can upload vector art. Some of the uploads have been PDFs, which default to the crop box. But their art is smaller (logos and such), so we get a lot of extra space around the logos when they "Fill" the graphic frame. I am hoping that the PDFBoundingBox will allow me to change that default to ArtBox so the logos will come in and size to fill the graphic frame without all of the extra space. What I keep getting wrong is the format of the code. I am not a programming expert. I have the code from FusionPro: <FusionProGraphicFrame>.PDFBoundingBox So where do I put the "ArtBox" instruction? I am guessing that "FusionProGraphicFrame" needs to be changed to the name of my graphic frame in FusionPro. Should this also be in a "OnRecordStart" rule? I am guessing it should be. I was hoping to find an example that gave me a basic understanding of how to format the code so I could learn how to set it up and format mine. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted February 21, 2018 Share Posted February 21, 2018 I see. Yes, you could use the PDFBoundingBox of a FusionProGraphicFrame object, returned from a FindGraphicFrame call, in OnRecordStart, like so: FindGraphicFrame("YourFrameName").PDFBoundingBox = "ArtBox"; But that assumes that you're also setting down a graphic with the FusionProGraphicFrame.SetGraphic function, like so: FindGraphicFrame("YourFrameName").SetGraphic("someFileName.pdf"); Or, to combine these calls: var myFrame = FindGraphicFrame("YourFrameName"); myFrame.SetGraphic("someFileName.pdf"); myFrame.PDFBoundingBox = "ArtBox"; However, that's not the only way you can do this. There's also the pdfbbox property of the FusionProResource object. Assuming you already have a regular Graphic rule of some kind (not a callback such as OnRecordStart), which does something like this: return CreateResource(Field("SomeFieldName")); You can modify that rule to do this: var myResource = CreateResource(Field("SomeFieldName")); myResource.pdfbbox = "ArtBox"; return myResource; Or, if you have a different rule, you can either post it here and I can suggest how to apply the same change to it, or you can just leave that rule alone and create a new Graphic rule to call the old one and apply the bounding box to the resource it returns, like so: var myResource = Rule("OldRuleName"); // Presumably the other rule returns a graphic resource. myResource.pdfbbox = "ArtBox"; return myResource; Then use the new rule in your Graphic frame instead of the old one. Quote Link to comment Share on other sites More sharing options...
Printing Partners Posted February 22, 2018 Author Share Posted February 22, 2018 Thanks Dan!!! I used the OnRecordStart approach and it is working fine. Thanks again. 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.