PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 8:23 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Nov 20, 2023 12:08 pm 
Offline

Joined: Mon Nov 13, 2023 10:40 am
Posts: 2
I have an image PNG in base64:

iVBORw0KGgoAAAANSUhEUgAAAHMAAABSCAYAAABns+t1AAAAAXNSR0IArs4c6QAABW5JREFUeAHtm+tx2zoQhVWCO7j6EwcLgDMqISWkg5sO4g6SDuwO4g5SgktQCSrBJeTOglwaAhcPPqxcJsczGkoguAC/swAWS/pwwB8IgAAIgAAIgAAIgAAIgAAIgAAIgAAIgAAIgAAIgAAIgAAIgAAIgAAIgMC7EjDGfyLrf334YE/v2tBK48baL9zP4/F0t9LUn3u5iMlH7S6N9d+s616dc4/a+VuVGeu/s5hE9M+t2txdOzUxyXaXAPE3g4SYDa5VE/MjuYd+RPinBnPvVgViNqCtidlg4iZVIGYDZojZAGkvVSDmXpRq6CfEbIC0lyoQc1Dqnugz78HG0J3D9zUfcg+pE1jb/Vhl86o/3SVNDkDMgbgh97wdaN4Q+5dUzE3tW/+LMylxGzUxT6fTHfeLiD7H18n34fxP7fzxeLwj5x6I/E/er745fnfpbbpHY8xRbJWOW0Sz1toT98Va92PS1t8gJsNmh0qdQGBo53sRu0e+zlr/asi/fCT3xILwJ3x3/kUcleHWRF0rJjttcCZyZ+6f9H88QszDIRWz/80jz12MsV9UcANBrjuKZLtLSdCx3oJ0njHu3+A41D1n+zNmR67WpRXrpjLNmsiDxZNXHZPpsjbNpmKNnhwJwv3hkfsmZAFaauAwOAS5C0/FuUT6UjGJ/FcRUml6eREnrXNChOmocf3I9SBMb3EuNXUycuf02i3FDHlcWpb2k35Y67+nfeTfS8QU3jmbWjtNZaOHpIDltxLJNhmOKlnLgUZmZgjT3jTYEIh8jEyNX1tH5hDQXLLT2Ggx/2WYhV610TlXTHLjmq06R74XlTMhispB7oOE1Q2KF2pilkb9ZmLyVGuuI+UKlsnpUl/miCnbuc1H5LiO5MRcOC3FJEpCsrj39/q2gm2UAPbn26JZsv417tOS72Gbw5wUJi1ihmWGt1EbONak/w1r2KppiRvkxIU2GqWs5p2biakEbxMgDQW87hplH1gTc1gOzjwLlZy3oQt6lbCOZEckh+7TNUy3pJfy9W8bcWWtVDw8tbShmJs87yTnz8xt0s/Cmwbx7MdLWnrt6t+lqa+0hrU2HN+AjMKroxK5ara3EpNHjmZ/blkIgmaIOXIIW5uQpPg2t81i/ZKQAfgGkStZf74SL54BMpGr1uk9i8mjMM7qkPNPzOSeOjX1qN1/sWztGlY0PpyUsFsTc+6o36uYnNXpheyehdkQQLGTv/KIlfJFRzawdg2rNVwb9XMX/z2KOe7ZlZggTLuVbFKN8ZCjjN5ki6e9EG671ZHreBOp7eF3LXLVbmJvYrbsIeWe+AmJds/Vsq3WsFxD4/qQEVLbm+VsxeVy43yMy+V7H2C0PDW5UQDUmGSRvLm1fl5AtOUaJhDjYw+0OOonOdf4+tL33Yk5I3iUgCjnqBMutTWMZjQ+MX44HFoSDyy2dm1L2f7EbH+jfVZAJP//oEWVXCYPXRl26ycVoJg8D2kr86nVNtdLE+F/spjMku+ZI/zS47XAPDzyya1hC8vjIEZA55xlaXk87UgbcVnsUAyD26m/aXCjNXPRw+n+n6PU10XkZpfCLF4XZT+M7cJ/PhXrL3CaWJi/QUzWqxoQbQ052IOYL3NzszK4akeiLryAp85CEDN+B+j/O82KyMWAqA99ecuw4SeKfof16rypfevPbFdukN+jZadUvVXez+GpPHl3SK6XZ5BrH0yLPeK3JaLZaSwf/htNewtB6rQcA9MhQ9RSH3VAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAARAAASmBP4DNJgnPshDmNkAAAAASUVORK5CYII=

How can I add this image in my PDF file?


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 20, 2023 2:21 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 916
Location: CCAA
Prefix the BASE64 encoded string with "BASE64:" and pass it as a filename when adding images in MigraDoc.

When using PDFsharp, decoder the image in your code and create a MemoryStream from the decoded bytes.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 11:50 am 
Offline

Joined: Mon Nov 13, 2023 10:40 am
Posts: 2
Can you give me an example how I can do this?


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 12:46 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 916
Location: CCAA
antoniobadaro wrote:
Can you give me an example how I can do this?
For which case?

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 373 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group