Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
|
Load file into XML as Base64 Encoded ContentLoads any type file into an XML document. The file content is encoded as base64. LOCAL loDocRoot LOCAL lnSuccess LOCAL lnZipContent LOCAL lnEncryptContent LOCAL lcEncryptPassword LOCAL loPdfNode LOCAL lnUnzipContent LOCAL lnDecryptContent LOCAL lcDecryptPassword loDocRoot = CreateObject('Chilkat.Xml') loDocRoot.Tag = "myDoc" * To zip compress the content, set this flag to 1 lnZipContent = 0 * To 128-bit AES encrypt the content, set this flag to 1 lnEncryptContent = 0 lcEncryptPassword = "" loPdfNode = loDocRoot.NewChild("pdf","") * Embed a PDF into XML lnSuccess = loPdfNode.SetBinaryContentFromFile("sample.pdf",lnZipContent,lnEncryptContent,lcEncryptPassword) IF (lnSuccess <> 1) THEN =MESSAGEBOX(loPdfNode.LastErrorText) RELEASE loPdfNode QUIT ENDIF =MESSAGEBOX(loPdfNode.LastErrorText) * Display the entire XML document: ? loDocRoot.GetXml() * Get the Base64-encoded content and display it: ? loPdfNode.Content * Extract the binary content from XML: lnUnzipContent = 0 lnDecryptContent = 0 lcDecryptPassword = "" lnSuccess = loPdfNode.SaveBinaryContent("out.pdf",lnUnzipContent,lnDecryptContent,lcDecryptPassword) IF (lnSuccess <> 1) THEN =MESSAGEBOX(loPdfNode.LastErrorText) RELEASE loPdfNode QUIT ENDIF RELEASE loPdfNode =MESSAGEBOX("Success!") |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser