I’m trying to decode data of this format in pdf:
...OSAwMDAwMCBuDQowMDAwMDc4NTc1IDAwMDAwIG4NCjAwMDAwODIyNzggMDAwMDAgrnbg0KdHJhaWxlcgo8PAovU2l6ZSAzOQovUm9vdCAzNCAwIFIKL0lEIFsgPDYwZjJlrnOWI4ZjU5MTRmZjU5M2E3NDk5NTcyNWZhYTY2PiA8NjBmMmU5YjhmNTkxNGZmNTkzrnYTc0OTk1NzI1ZmFhNjY+IF0KPj4Kc3RhcnR4cmVmCjgyMjk5CiUlRU9GCg==
But my file does not open “failed to open the file”, when I try to open a PDF file in text format, I get the following:
%PDF-1.7
%
1 0 obj
<<
/Filter /FlateDecode
/®tЖVжwF‚" ўфЖVжwFѓC3C#@ўфЖVжwFѓ" ўфЖVжwFѓ2
з0
>>
stream
xњнЅ XTЧщ8|О№ЛМЬЩо3МАМ…ЃqQ"»®t!ЕA@MI‰ZBa¦*$™іDЅ№ѓG№¦`EMKK”ЩєCf™:kъdЫJЦ”ЪзЫZ›Efѕчњ{п0dйУяп{ 3зЮчњ{оYЮу®gFIЁqHiЬ®}_°€•ЅgvНѓПЩC cф.n€kiЮ¶ыѕжы1/бКWµ№Ў№Єзю¶ёжBkбќi-ђа,4™ ѕв9-›»ЇМтЬс„0jkol@Ж?AЩ›hњЯ®}ЗXsЊЯ@Д&Ш9эќ+—ќ*—Ігр„ЯҐdvw<x7ЮиsЎ.@јuЄз„tб1”Ж‡ђЎш_ њЈчXkь}NпЮ@ѓZ@иqф4nEOЈзРуш<јх:Љ®}щ |Ф]фmzъ-Ф„JІQe@Qр+шќ> 2ЃуР‡‡‘ Ш+ВЅ^Ѓ„¬]пЉз{иztч:јuІўlT†*Q;є...
My code:
await fs.writeFileSync('output.pdf', Buffer.from(my_string, "base64"));