1. Describe the bug
I'm having a strange behavior when converting some PDF files to base64 by code. I have used the codeunit "Base64 Convert" with the function "ToBase64". I have also used the dotnet "Convert" with the function "ToBase64String" but the result is the same. The result is that a line is inserted into the Base64 string that says something like the line is too long and removes a part of the string. This only happens with some PDF files. Specifically a file that causes problems is a scanned PDF file but on a website that encodes PDF files to base64 the result is correct.
Also if we create a dll in c# the result is correct but using that dll from Business Central the result is incorrect.
2. To Reproduce
Steps to reproduce the behavior:
Add like document attachment a scanned PDF file or a too long PDF file to a purchase invoice.
Try to convert to base64 string the document attachment using the codeunit "Base 64 Convert" and introduce the result into text variable without length..
3. Expected behavior
The complete base64 as it appears on websites to convert PDF files to base64.
4. Actual behavior
The result is a base64 shortened and with a line indicating that a part has been removed.
Wrong Base64.txt
5. Versions:
AL Language: v9.0.605172
Visual Studio Code: 1.66.0
Business Central: ES Business Central 17.1 (Platform 17.0.18204.18738 + Application 17.0.16993.0) (OnPrem)
1. Describe the bug I'm having a strange behavior when converting some PDF files to base64 by code. I have used the codeunit "Base64 Convert" with the function "ToBase64". I have also used the dotnet "Convert" with the function "ToBase64String" but the result is the same. The result is that a line is inserted into the Base64 string that says something like the line is too long and removes a part of the string. This only happens with some PDF files. Specifically a file that causes problems is a scanned PDF file but on a website that encodes PDF files to base64 the result is correct.
Also if we create a dll in c# the result is correct but using that dll from Business Central the result is incorrect.
2. To Reproduce Steps to reproduce the behavior:
3. Expected behavior The complete base64 as it appears on websites to convert PDF files to base64.
4. Actual behavior The result is a base64 shortened and with a line indicating that a part has been removed. Wrong Base64.txt
5. Versions: