Convert Base64 to PDF File Convert Base64 to PDF File - Berguru IT - Tutorial Visual Basic, Networking, Tips dan Trik
VB.Net

VB.Net Tutorial Untuk pemula

Instant Article

Cara Membuat Instant Article Untuk Blogger

logo

Convert Base64 to PDF File

base64 pdf file vb.net convert

Cara Convert base64 ke PDF

kali ini saya mau sharing cara convert base64 file to pdf file menggunakan VB.Net. Biasanya kegiatan convert base ini dilakukan karena ada file bentukan PDF dijadikan file Base64 dengan tujuan supaya mudah disimpan di database dan tidak memakan banyak byte di dabase. Nah kebetulan saya ada kerjaan nih convert file base64 to pdf. okeh langsung aja ke TKP...



1. Buat project baru di VB.Net.
2. Siapkan File code Base 64 nya Okeh seperti ini code base64 nya .
JVBERi0xLjQKJf////8KMzggMCBvYmoKPDwvTGVuZ3RoIDI0NzgKL1N1YnR5cGUgL1hNTAovVHlwZSAvTWV0YWRhdGEKPj4Kc3RyZWFtCjweHBhY2tldCBiZWdpbj0n77uJyBpZD0nVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkJz8+Cjx4OnhtcG1ldGEgeDp4bXB0az0iMy4xLTcwMSIgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iPgogIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNi0xMi0xN1QwNTo1Mjo0OFo8L3htcDpDcmVhdGVEYXRlPgogICAgICA8eG1wOkNyZWF0b3JUb29sPk5pdHJvIFBybyA5ICAoOS4gMC4gMy4gMik8L3htcDpDcmVhdG9yVG9vbD4KICAgICAgPHhtcDpNb2RpZnlEYXRlPjIwMTYtMTItMTdUMDU6NTI6NTBaPC94bXA6TW9kaWZ5RGF0ZT4KICAgIC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4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyI+CiAgICAgIDx4bXBNTTpEb2N1bWVudElEPnV1aWQ6NWRmYzQ3MGEtZjdlNy00OWZhLTlhMjYtMzUzNjY3NTNhYmYzPC94bXBNTTpEb2N1bWVudElEPgogICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KPD94cGFja2V0IGVuZD0ndycPgplbmRzdHJlYW0KZW5kb2JqCjM3IDAgb2JqCjw8L0F1dGhvciAov8AQQByAGkAcykKL0NyZWF0aW9uRGF0ZSAoRDoyMDE2MTIxNzA1NTI0OFopCi9DcmVhdG9yICj+wBOAGkAdAByAG8AIABQAHIAbwAgADkAIAAgAFwoADkALgAgADAALgAgADMALgAgADIAXCkpCi9Nb2REYXRlIChEOjIwMTYxMjE3MDU1MjUwWikKL1Byb2R1Y2VyICj+wBOAGkAdAByAG8AIABQAHIAbwAgADkAIAAgAFwoADkALgAgADAALgAgADMALgAgADIAXCkpCj4+CmVuZG9iagozNiAwIG9iago8PC9EZWNvZGVQYXJtcyBbbnVsbCBdCi9GaWx0ZXIgWy9GbGF0ZURlY29kZSBdCi9MZW5ndGggMjE1Cj4+CnN0cmVhbQp42mxQy4rDMAy85yt0bOnBfdBbKJSUQg5tl80XOLYSBI1sFOeQv6tZPew7BwspJkRI6uqvtVMAdSXONNggI7YCo5uEoPQYk9cHI5gyYS1y68ZtC9UNDfzGHCouXNwWlR28qtSfccyBplh86QgbgsWu0K9xKIQ97C5ZuwqaZWaKWbyfs3DsgBznmCbHM9LGuNszh6bVA091iU+4gLlPeIS9L+4VdX20jh6VLrh8+LUi3VQtn3pAMJNIzJJPU2mashDj7x9555MrxwAAADwMAKm1vKwplbmRzdHJlYW0KZW5kb2JqCjM1IDAgb2JqCjw8L0RlY29kZVBhcm1zIFtudWxsIF0KL0ZpbHRlciBbL0ZsYXRlRGVjb2RlIF0KL0x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KPn1Pb5J7U2mglNZFLFjwjuFB0agqba33lavAvTmDJGLOeig2yf3lzyWVRGu1jFsURxIhVUkAHdofBE8Wy8a63v8hSWq89Kq21uyXrHavG3rYXCI7gzrIjuYBq4nazafqft3lw8gd93MDCvut40wvb5KrvNQB+G0VWGH4IMsAzAY54H02YkXnjrPKJ3NaWO0gLkI5M6+L6YfsHAAD0xWTWvbQBDdVWzr02ByCAVdbLYyhUAKPZVQEqGSpm5O8QdoTQ9yFYN767EtLehmozS6yq5yLkVeu1P6W9w3+zKrYVka9+8fTO7npn1h7KK4LTVbY6R12UYnRXikn6KtTBj9Pv4Vfyfcxu+M00gZTFkkrwzW0V881knm57+N++mab3FrdeZ4msnsKWbvuMxRq1CCWQBn0akNIYA0fzw23MWKGtLQ3ocV5zpjFnj3GW15bBesbRUDuKmQVLy1jiPbsFzDFYYdjPGrYDS48sjwwHCdNGc1WMNjj22rETu3FgdS1sKUH3QB7BdTl7CHiXhxU0xxqueVG5cbjVSuOGWYBJWPEPQ+REOxCCP7Pw2f8VzObpQ8CgrzBSOhCFj5ZIYdwnlz17yjvslVmUnqHuwEuYqbKy4umLLEBSLuBMoTy0T5IiH8kvBLg3cIt5H5ITjx6amW2YCjRgVk7KQm1o7Isl+vdtN08Hv8I8coJbe45mnyj3F4daO3oF3TU8G+FoV+YLiYLOU5trRKJeoy70gKCPlQsFtFMB4o+dQvWFSjlxbCP0KGK2jkEqektP0o9T12lPsrThXnaHRbA/J0XNZHosXuvmg1r1oTV8uYmOT1CAh
(Inget Jangan copy code base64 diatas, ntar error loh.. soalnya code diatas dah saya cut sebagian)

 3. Pada Form1 masukan MemoEdit1.text (ini bawaan nya devexpress)ke dalam form.
 4. Dan Masukkan button1 ke dalam form, Buatlah seperti gambar ini.
Form convert base64 button textbox vb.net

5. Jika sudah masukkan coding nya kedalam button1(Double klik di button nya)
koding convert base64 to pdf file vb.net

nih biar bisa di copy dari sini..

Dim str As String = MemoEdit1.Text
Dim Base64Byte() As Byte = Convert.FromBase64String(str)
Dim obj As FileStream = File.Create("C:\FilePDF\test.pdf")
obj.Write(Base64Byte, 0, Base64Byte.Length)

obj.Flush()
obj.Close()
If MsgBox("Open file PDF ?", MsgBoxStyle.OkCancel, "Info") = MsgBoxResult.Ok Then
          System.Diagnostics.Process.Start("C:\FilePDF\test.pdf")
End If

6. Lalu Jalankan programnya dan copy paste kan file base64 nya ke dalam memoedit1, lalu klik button1 nya, liat apa yang terjadi....

Lebih Jelasnya liat dari youtube aja.. nihh disini...

www.youtube.com or liat langsung dibawah ini.



Selamat anda sudah bisa convert base64 nya...

Pengen belajar visual basic .net dari awal cocok untuk pemula silahkan menuju ke alamat ini : Tutorial VB.Net Untuk Pemula

Sekian dari saya kalo ada yang ingin ditanyakan please komen aja nanti segera dijawab.




Tags

0 Komentar untuk "Convert Base64 to PDF File"