web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Adobe Acrobat Reader could not open 'Proof1.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).

(0) ShareShare
ReportReport
Posted on by 449

Hello Everyone,

Getting below error while adding attachment on mail through instream.

"Adobe Acrobat Reader could not open 'Proof1.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)."

Below is the code: 

Extension A:

Local_Rec.CalcFields(Local_Rec."PDF Stream");
Local_Rec."PDF Stream".CreateOutStream(NVOutStream, TextEncoding::UTF8);
Local_Rec.Modify();
Extension B:(dependency added of Extension A)
Local_Rec.CalcFields(Local_Rec."PDF Stream");
Local_Rec."PDF Stream".CreateInStream(NVInstream, TextEncoding::UTF8);
SMTPMail.AddAttachmentStream(NVInstream, 'Art.pdf');
Thanks in Advance.
Categories:
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    The stream you're passing is not a valid PDF file for sure. Check your code and the way you create the PDF.

  • Manish Ratan Profile Picture
    449 on at

    Hi,

    I am using uploadintostream function to upload pdf file. And using that INsteream into extension A.

    If this doesn't look ok. Then can you please suggest any other way using INstream value of uploadintostream function.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans