Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6704833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:20:03+00:00 2026-05-26T07:20:03+00:00

Problem: I’m trying to get an image to be displayed on a PDF that

  • 0

Problem:

I’m trying to get an image to be displayed on a PDF that is generated using a XDP file.

What I’m currently trying:

I have a XDP file that is exported from a PDF. I have a textbox with the tag “my_image” on the pdf. Here’s the code I’m using to encode the string that is inserted as the value of the “my_image” tag.

var bytes = System.IO.File.ReadAllBytes(@"C:\image.jpg");
var data = Convert.ToBase64String(bytes);

When I launch the PDF using the XDP, the image does not display, just the Base64 Encoded string value.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:20:04+00:00Added an answer on May 26, 2026 at 7:20 am

    I made a simple PDF in LiveCycle Designer with a single Image Field called ImageField1. I used pretty much the same code as you to create the base64 encoded image except that I included the line wraps which shouldn’t technically be needed:

    var testImage = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Untitled.png");
    var bytes = System.IO.File.ReadAllBytes(testImage);
    var data = Convert.ToBase64String(bytes, Base64FormattingOptions.InsertLineBreaks);
    

    All together this is my XDP file that works with my simple PDF. I know its not a complete answer but hopefully you can compare what works for me with your code.

    <?xml version="1.0" encoding="UTF-8"?>
    <?xfa generator="XFA2_4" APIVersion="3.0.11111.0"?>
    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
    <xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
    ><xfa:data
    ><topmostSubform
    ><ImageField1 xfa:contentType="image/png" href=""
    >iVBORw0KGgoAAAANSUhEUgAAAMYAAAC2CAYAAACCufKcAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
    jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAApDSURBVHhe7Z27j9xUFIf5Q+hCRarQbZcKKlIl
    VahIFSpEgyiQKJAoEAVSikgUSClSREoRpUE0URpEE6VBNFEqqFYiy+SxWfIa9jfBxDvr8T1n5o59
    fc9naYXI2h6f79xv73v81pwDAhA4RuAtmEAAAscJIAalAgIdBBCDYgEBxKAMQMBGgBrDxomzghFA
    jGAJJ1wbAcSwceKsYAQQI1jCCddGADFsnDgrGAHECJZwwrURQAwbJ84KRgAxgiWccG0EEMPGibOC
    EUCMYAknXBsBxLBx4qxgBBAjWMIJ10YAMWycOCsYAcQIlnDCtRFADBsnzgpGADGCJZxwbQQQw8aJ
    s4IRQIxgCSdcGwHEsHHirGAEECNYwgnXRgAxbJw4KxgBxAiWcMK1EUAMGyfOCkYAMYIlnHBtBBDD
    xomzghEoToznv/0+P7h2fb7/3ff//+j/9e8cEBiKQDFivJrN5g8/+nj+19vvrPyZnTk7f3Hv/lBs
    +JzABI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YnWWNXcntaycssK2oYJtcXxumPS
    Yqzb72gKRG2CaOTO0sk+MnpHbdHZoqpCjHX7HTUJoqZQ6qtwOr9hkJW0dYuxqRxTnhhcRwr1K2pu
    TnpWBHSdW02NcaRZtUanfKrDu+pPeGsKjdCxMqBfnerEULhqa2sxnGWzU1fzYgoTg94Odlt8pEjX
    J1WK0Q5bIy6W1bnLgkiOJ198uVj6XtKxrhCLRZaHzafS4imJbftZqhejqUH0BQvrCKICpaFPtcfH
    3GO+iRDalafnZ67CrmEIMTad91ieQR+yKbKJECwjt4tQ1QTfumHrL+c6E4Ptdrr6MNv+8UzSdQ7F
    Bnpn3rplYdV1oWqMZQjeBYmWNUclnMNQ7OaahBYjx9xHCSK0n0H9iSGbepsXwTLvEF6MhRyHI0+e
    TVClyaDnkRBjDg6UWbzXfyrE+I+dvrhNQ7tTEwQh1i/8fVcixhId7dmYghwIsR0hmrsiRgdf1R7a
    I70YdTrcv7HOvo9tNbcQYrtCIIaDr5aYbDK8m0MShHAkLMOp1BgOiJr/eHrl6tbnL9rzI6q5GGVy
    JCnTqYiRCSS3qYsAYtSVT6LJRAAxMoHkNnURQIy68kk0mQggRiaQ3KYuAohRVz6JJhMBxMgEktvU
    RQAx6son0WQigBiZQHKbugggRl35JJpMBBAjE0huUxcBxKgrn0STiQBiZALJbeoigBh15ZNoMhFA
    jEwguU1dBBCjrnwSTSYCiJEJJLepiwBi1JVPoslEADEygeQ2dRFAjLrySTSZCCBGJpDcpi4CiFFX
    PokmEwHEyASS29RFADHqyifRZCKAGJlAcpu6CCBGXfkkmkwEECMTSG5TFwHEqCufRJOJAGJkAslt
    6iKAGHXlk2gyEUCMTCC5TV0EEKOufBJNJgKIkQkkt6mLwL8Ifb+k376AhQAAAABJRU5ErkJggg==</ImageField1
    ></topmostSubform
    ></xfa:data
    ></xfa:datasets
    >
    <pdf href="Untitled1_distributed.pdf" xmlns="http://ns.adobe.com/xdp/pdf/"
    /></xdp:xdp>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have a large Visual C++ project that I'm trying to migrate to
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem: We have a web app that calls some web services asynchronously (from the
Problem! I Have the following input (rules) from a flat file (talking about numeric
Problem: I have 2 classes, DB class and a User class, that will work
Problem I have a Silverlight 5 application using the treeview from the SDK. Now
Problem: Trying to create a Mix that is applied to the AVPlayerItem, but it
Problem: I call a PHP file using an HTTPService. I set the result of
Problem is that application closes without any error, VS stays opened. I have multiple
Problem: I have a monitor program in Python that uses subprocess' Popen to start

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.