Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Button1_Click()
- Dim myFile As String, text As String, textline As String, posLat As Integer, posLong As Integer
- myFile = "C:\Users\rukes\Desktop\vbapdf\in.txt"
- Open myFile For Input As #1
- Do Until EOF(1)
- Line Input #1, textline
- text = text & textline
- Loop
- Close #1
- Call saveBase64ToPDF(text)
- End Sub
- Sub saveBase64ToPDF(bs As String)
- Dim strTempPath As String
- Dim b64test As String
- b64test = bs
- ' zde si nastavte cestu, kam se má PDF uložit, aktuálne do slozky, kde je tento soubor
- ' dalsi moznost:
- ' strTempPath = "C:\data\file.pdf"
- strTempPath = ThisWorkbook.Path & "\temp.pdf"
- Open strTempPath For Binary As #1
- Put #1, 1, DecodeBase64(b64test)
- Close #1
- End Sub
- Private Function DecodeBase64(ByVal strData As String) As Byte()
- Dim objXML As Object 'MSXML2.DOMDocument
- Dim objNode As Object 'MSXML2.IXMLDOMElement
- Set objXML = CreateObject("MSXML2.DOMDocument")
- Set objNode = objXML.createElement("b64")
- objNode.DataType = "bin.base64"
- objNode.text = strData
- DecodeBase64 = objNode.nodeTypedValue
- Set objNode = Nothing
- Set objXML = Nothing
- End Function
Add Comment
Please, Sign In to add comment