unable to generate PDF from text Value
Application Type
Traditional Web

Hi

i have one requirement that i have Textvalue and that value i have to generate in PDF.so from text value i am converting in to base64 and from Base64 to convert to binary but when i am trying to download that binary content in pdf file it is not generating the PDF.getting "failled to pdf load"

Text Sample

MASTERINVNBR,PONBR,ORDERDATE,FS_,QTY,UNIT,CATALOG_,DESCRIPTION,UNIT_,EXT_,TAX,TOTAL

"076751021521","80845","110520","A03109916","1","CS","14387068    ","MATRIX RESERVOIR 100ML IW 50CS","147.51000000","147.51000000","0","147.51000000"

"076751021521","81491","12121","A10219848","2","PK","AAJ62338EQF ","LB AGAR PLT W 50MG/ML 20PLATES","109.13000000","218.26000000","0","218.26000000"

"076751021521","81491","20121","A10323440","2","PK","0666611     ","KAYDRY EX-L 2-PLY 15X17 90/PK ","15.25000000","30.50000000","0","30.50000000"

"076751021521","81491","20321","A10342522","2","CS","10977023    ","DISTILLED WATER (ULTRAPURE)   ","195.00000000","390.00000000","0","390.00000000"

"076751021521","81491","20521","A10364271","2","PK","06666A      ","KIMWIPE SML 4-1/2X8-1/2 280/PK","2.29000000","4.58000000","0","4.58000000"

"076751021521","81491","20521","A10364271","1","CS","0720089     ","PLT 96 WELL LOW EVP .365 50/CS","109.02000000","109.02000000","0","109.02000000"

"076751021521","81491","20521","A10363563","2","EA","A25602      ","FG TAQMAN 1STEP CELLS TO CT   ","5860.00000000","11720.00000000","0","11720.00000000"

"076751021521","81491","20421","A10356834","1","EA","31985062    ","OPTI MEM I                  RX","23.70000000","23.70000000","0","23.70000000"

"076751021521","81491","20921","A10404659","2","CS","1367811D    ","PIPET SER STL 1/10 5ML 200/CS ","43.77000000","87.54000000","0","87.54000000"

"076751021521","81491","20921","A10404659","1","CS","1367610J    ","PIPET STER 10ML(0.1GRAD)200/CS","53.60000000","53.60000000","0","53.60000000"

"076751021521","81491","21021","A10410166","1","CS","1367811D    ","PIPET SER STL 1/10 5ML 200/CS ","43.77000000","43.77000000","0","43.77000000"

"076751021521","81491","21021","A10410166","1","CS","1367811F    ","PIPET WRAP 50ML(0.5GRAD)100/CS","137.34000000","137.34000000","0","137.34000000"


"076751021521","81491","21021","A10418765","6","EA","12604013    ","TRYPLE EXPRESS                ","29.02000000","174.12000000","0","174.12000000"


after converting Base64

TUFTVEVSSU5WTkJSLFBPTkJSLE9SREVSREFURSxGU18sUVRZLFVOSVQsQ0FUQUxPR18sREVTQ1JJUFRJT04sVU5JVF8sRVhUXyxUQVgsVE9UQUwNCjA3Njc1MTAyMTUyMSw4MDg0NSwxMTA1MjAsQTAzMTA5OTE2LDEsQ1MsMTQzODcwNjggICAgLE1BVFJJWCBSRVNFUlZPSVIgMTAwTUwgSVcgNTBDUywxNDcuNTEwMDAwMDAsMTQ3LjUxMDAwMDAwLDAsMTQ3LjUxMDAwMDAwDQowNzY3NTEwMjE1MjEsODE0OTEsMTIxMjEsQTEwMjE5ODQ4LDIsUEssQUFKNjIzMzhFUUYgLExCIEFHQVIgUExUIFcgNTBNRy9NTCAyMFBMQVRFUywxMDkuMTMwMDAwMDAsMjE4LjI2MDAwMDAwLDAsMjE4LjI2MDAwMDAwDQowNzY3NTEwMjE1MjEsODE0OTEsMjAxMjEsQTEwMzIzNDQwLDIsUEssMDY2NjYxMSAgICAgLEtBWURSWSBFWC1MIDItUExZIDE1WDE3IDkwL1BLICwxNS4yNTAwMDAwMCwzMC41MDAwMDAwMCwwLDMwLjUwMDAwMDAwDQowNzY3NTEwMjE1MjEsODE0OTEsMjAzMjEsQTEwMzQyNTIyLDIsQ1MsMTA5NzcwMjMgICAgLERJU1RJTExFRCBXQVRFUiAoVUxUUkFQVVJFKSAgICwxOTUuMDAwMDAwMDAsMzkwLjAwMDAwMDAwLDAsMzkwLjAwMDAwMDAwDQowNzY3NTEwMjE1MjEsODE0OTEsMjA1MjEsQTEwMzY0MjcxLDIsUEssMDY2NjZBICAgICAgLEtJTVdJUEUgU01MIDQtMS8yWDgtMS8yIDI4MC9QSywyLjI5MDAwMDAwLDQuNTgwMDAwMDAsMCw0LjU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xNjYsMSxDUywxMzY3ODExRiAgICAsUElQRVQgV1JBUCA1ME1MKDAuNUdSQUQpMTAwL0NTLDEzNy4zNDAwMDAwMCwxMzcuMzQwMDAwMDAsMCwxMzcuMzQwMDAwMDANCjA3Njc1MTAyMTUyMSw4MTQ5MSwyMTAyMSxBMTA0MTg3NjUsNixFQSwxMjYwNDAxMyAgICAsVFJZUExFIEVYUFJFU1MgICAgICAgICAgICAgICAgLDI5LjAyMDAwMDAwLDE3NC4xMjAwMDAwMCwwLDE3NC4xMjAwMDAwMA0K


i am trying to generate PDF online with value of this Base64 throgh below link

https://base64.guru/converter/decode/pdf

getting below error.it is showing MiME type is "text/plain"



mvp_badge
MVP

Hi Arkyadeep,

I'm not sure I understand what you want to do, and what you expect should work. From your description, it looks like you want to convert text to base64 and base64 to binary data, and then expect it to be a valid PDF? Because that is just not how things work. A PDF is a specific file format, you need some library to generate it. Perhaps you can describe a bit better what you want and expect, and then we can look at ways to achieve that.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.