using Microsoft.Dynamics365.LocalizationFramework;
String getBase64FromString(
System.IO.Stream _pdfStream)
{
str base64data = '';
if (_pdfStream != null)
{
using (System.IO.Stream fileStream = _pdfStream)
{
using (System.IO.MemoryStream memoryStream = new System.IO.MemoryStream())
{
fileStream.CopyTo(memoryStream);
base64data = ERConversionUtils::StreamToBase64(memoryStream);
}
}
return base64data ;
}
Condition:
Feature "Utilize application resources to perform CBD documents conversion from Word to PDF format" is enabled,
Then stream aligned to get Base64String.
Workaround logic:
str fileDownloadURL;
System.IO.Stream tempPdfStream;
fileDownloadURL = File::SendFileToTempStore(_pdfStream, this.parmSaveFilePath());
tempPdfStream = File::UseFileFromURL(fileDownloadURL);
No comments:
Post a Comment