Options

AL Byte[] to PDF

kanubelkarlkanubelkarl Member Posts: 1
edited 2019-04-23 in NAV Three Tier
Hello,
I've created a in C# a String with a Byte[] of a PDF
378068704549465510105232483211198106104073100101110116105116121411010111010011198106105332483211198106104065100111981014110101110100111981061056324832111981061060601047701051081161011143247701089711610168101991111001011047761011101031161043255...
Now I want to convert this string back to a PDF.

procedure CreatePDF()
var
lTempBlob: Record TempBlob temporary;
lstmoStream: OutStream;
lcuFileMgt: Codeunit "File Management";
i: Integer;
lText: Text;
begin
lText := GetString();
lTempBlob.Insert();
lTempBlob.Blob.CreateOutStream(lstmoStream);
for i := 1 to StrLen(lText) do begin
lstmoStream.write(GetBit(lText));
end;
gTempBlob.CalcFields(Blob);
lcuFileMgt.BLOBExport(lTempBlob, 'BlobToPDF.pdf', true);
end;
The function creates now a PDF, but I can't open it.

Versions:

AL Language: 3.0.107312
Business Central: 14.0.29487.0
Sign In or Register to comment.