Skip to Content
Author's profile photo Jerry Wang

How to render PDF which displays picture from the image attachment of your custom BO

 

My series of Cloud Application Studio Blogs

Requirement

You have created your custom BO with attachment upload functionality available via this blog Step by step to enable your custom BO with attachment upload functionality.
And now you have successfully uploaded two images as attachment to a given BO instance:
You would like that once preview button is pressed, the PDF will be generated which display these two images from uploaded attachment.
The rendered PDF looks as below:
This requirement just needs a few enhancement on the form template itself, whose development is already introduced in blog Step by Step to create an Adobe Print form in Cloud application Studio.
1. Open the form template via Adobe Form Designer, menu File -> Form Property:
Set PDF Render Format as Dynamic XML Form:
2. Select your body page and set the Content property as “Flowed” instead of “Positioned”:
3. Drag a table control from control toolbox, select table header node and DO NOT bind any BO nodes to it.
Select table row node, bind it to path: $.TestBO.Attachment.DocumentList[*] and mark the checkbox “Repeat Row for Each Data Item”:
Select the last column field in table row, change its type for Text Field to Image Field:
And use relative binding to bind its path to the corresponding BO field BinaryObject which stores the binary data of an attachment.
After that in the runtime when the PDF is rendered, the table row will automatically be created based on the number of uploaded images as attachment, this behavior is called as “Data Driven Layout process”.

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      nice

      Author's profile photo Dhruvin Mehta
      Dhruvin Mehta

      Hi Jerry,

      Thanks , its an amazing blog. 

      Thanks.

      Dhruvin

       

       

      Author's profile photo Dwarakanath Maligi
      Dwarakanath Maligi

      Hello Jerry,

      We have a requirement to embed the images attached to a quote in the output and also merge the pdf document in the attachment with the output. I tried to follow your step to embed the image attachment in the Quote for, output, but the table output comes out blank.

       

      Thanks

      Dwaraka M

      Author's profile photo Laura Castro Franco
      Laura Castro Franco

      Dear Dwarakanath,

       

      Did you find a solution? Could you please share it?

       

      Thank you very much in advance

      Author's profile photo Eelco Essenberg
      Eelco Essenberg

      Hi Jerry!

      Very useful. I'm trying to do the same with a standard BO (Delivery Note), and getting the attachment(s) embedded in the DeliveryNote form.

      But it would seem that in that scenario, ByD does not let me access either $.parent.Attachment.DocumentList[*], nor $.DeliveryNote.Attachment.DocumentList[*].

      Any ideas on how to do this for a standard BO with attachments?

      Thanks,

      Eelco

       

       

       

      Author's profile photo Kam G
      Kam G

      Hello,

      Thanks for the blog.

      I have a issue, i hope you can help me.

      I have a custom BO with quote items. If the items have pictures, sometimes (but not always) items are sliding down on the page and after sliding a blank page occurs.
      If i remove the pictures it gets fixed. I haven't been able to find the solution.
      You can see the screenshot below.