Inserting Image in a XDP

A common use case is the ability to insert a image into a xdp and render the xdp into a PDF.To do this you will need to create a XSD with an image element. Then you will create a XDP using the XSD. Bind the fields of the xsd to the fields on the form.

Then you will have to merge the xml data into the xdp and render the xdp into a pdf.

I have attached a simple process which reads a xml file,extracts the image field out of the xml data, populates another xml variable with the image data and renders xdp with the data
I have included the XSD,XML file which has the image as base64 encoded string,XDP file.Click on the file attachments icon of the PDF
Click here to get the PDF
This process was built using 8.2 version. In 8.2 there are two new functions which allow you to encode a document object into a base64 string or get a document object out of a base 64 string. These are document functions

Advertisements

16 responses to “Inserting Image in a XDP

  1. Hi Girish,

    In the blog you have mentioned that you have have attached a simple process which reads a xml file,extracts the image field out of the xml data, populates another xml variable with the image data and renders xdp with the data.

    I got the files from PDF attachment but looking for the process in the form of code.Can you please let me know the process/code.

    Your help in this regard is highly appreciated.

    Thanks for your posing though.

    Suren

    P.S.
    I’m from Pune working in US for FedEx and I hope you too are from there.Just a wild guess since Bedekar is quite famous last name.

  2. I do not have code. Can you please let me know what you are trying to do
    thanks
    girish

  3. I would like to render PDF using the java api for LCES. My inputs parameters are entered by the user in the web page like text and image field. I’ve LCES form template in the form of XDP. I would like to merge the data and form template.

    My requirement is
    1. How to create XSD with an image element
    2. How to create a XDP using the XSD
    3. How to bind the fields of the xsd to the fields on the form.

    Thanks,

    Suren

  4. Hi
    I have put the xsd, xdp files as file attachments in the pdf which is available in the post. Open the pdf, then click on the paper clip icon, you should see the attachments
    Create a xdp
    create a new data connection using the xsd
    let me know if you need any more help
    thanks
    girish

  5. I’m exploring more on java api to render PDF produced by different PDF versions. If you can help in getting the resources in regard to this will be really helpful.

  6. Girish,

    I need to do something that seems similar to that of your post: start with an empty (or almost empty) xdp, and in each activity, add a fragment to that xdp. After passing for many activities, I would get a final xdp that I would convert to pdf.

    Is this possible with any out-of-the-box activity from Livecycle? If not, can you point me in the right direction?

    Thank you

  7. it could be possible, are you in the US?If so can I talk to you a bit more to understand the use case?
    thanks
    girish

  8. I created an XDP and through a XML I want to load an image dynamically.

    How?

    • Girish Bedekar

      I am not sure you can load the images dynamically into pdf for security reasons
      what exactly are you trying to do?
      thanks
      girish

  9. Thanks a lot Girish Bedekar,
    Help me please

    I have an XDP with a field of type IMAGE FIELD and I want the image that is to take charge of an attribute of the XML that you pass to the binding.

    For example

  10. **************

  11. ………..

  12. href=’htpp://localhost/exampleTQ_Consulta.jpg’

  13. I want to do dynamic image binding in the form, Which I were able to do in the form usign designer.

    But when I generated the form using the service(renderPDFForm) it wasnt get bind.

    To generate the above forms I am using the XSD(schema binding) having “image Data node” and xml file for genrating the PDF
    plz see the below XML and XSD.

    xsd is

    xml is

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s