Bigtext variable with PDF file in coded (Base 64) string

denpar
Member Posts: 80
Hi all,
I have a BigText variable with a data string (coded Base 64). I would like to decode the string to a PDF file.....
I think this is possible using Convert.FromBase64String, but I can't find how this can be done?
I have a BigText variable with a data string (coded Base 64). I would like to decode the string to a PDF file.....
I think this is possible using Convert.FromBase64String, but I can't find how this can be done?
If your work becomes a passion...
www.pardaan.com
www.pardaan.com
0
Comments
-
Solved it....
abpBigPDFText BigText
abpAutConvertBase64 DotNet 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Convert
abpAutBytes DotNet 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Array
abpAutMemoryStream DotNet 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.MemoryStream
abpOutStream OutStream
abpRecTempBlob Record TempBlobabpAutBytes:=abpAutConvertBase64.FromBase64String(abpBigPDFText); abpAutMemoryStream:=abpAutMemoryStream.MemoryStream(abpAutBytes); abpRecTempBlob.Blob.CREATEOUTSTREAM(abpOutStream); abpAutMemoryStream.WriteTo(abpOutStream); abpRecTempBlob.Blob.EXPORT('c:\temp\test.pdf');
If your work becomes a passion...
www.pardaan.com0 -
Blob.EXPORT and Blob.IMPORT are deprecated in NAV2009 and can no longer be used in NAV2013. I seriously believe you shouldn't write any code nowadays which won't run in NAV2013, unless you're working on even older versions. It would be better to call the std. NAV function for exporting a blobfield to a file, like the ones in codeunit 419 in NAV2013.0
-
@Marijn
I agree...
But unfortunately some of our customers are still using NAV 2009 (mainly caused by the economic situation)!If your work becomes a passion...
www.pardaan.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions