title: Generating PDF from Base64 string in VBA
body: <p>I have the following JSON response:</p>
  
  <pre><code>{
    "status": "Success",
    "label": "pdf_base64_string",
    "order": "ABC123456"
  }
  </code></pre>
  
  <p>I'm trying to save a PDF file from the Base64 string per the following code:</p>
  
  <pre><code>FileData = Base64DecodeString(pdf_base64_string)
  fileNum = FreeFile
  FilePath = "C:\label.pdf"
  Open FilePath For Binary Access Write As #fileNum
       Put #fileNum, 1, FileData
  Close #fileNum
  </code></pre>
  
  <p>This results in a broken/invalid PDF file (not recognized by the PDF viewer).</p>