Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
web:pdf [2019/06/06 01:50]
agcyphers
web:pdf [2019/07/19 18:01] (current)
agcyphers [Examples]
Line 71: Line 71:
  
 ==== Examples ==== ==== Examples ====
-There are currently no examples for this class.+=== Saving PDFs on the Server === 
 +This is a simple example of saving PDF data to a file on the server. Note that this saves to the same place each time, and could potentially fail based on target and permissions. You should modify this to save each file separately in a safe place. 
 + 
 +This code belongs in the PDFOutput Event Handler on your WebPage or WebContainer. 
 + 
 +<code xojo>dim b64Content as String = theContent.NthField( ",",​ 2 ) 
 +dim f as FolderItem = GetFolderItem( "​newPDF.pdf"​ ) 
 +if not IsNull( f ) then 
 +  dim b as BinaryStream = BinaryStream.Create( f, True ) 
 +  b.Write( DecodeBase64( b64Content ) ) 
 +  b.Close 
 +end if</​code>​
  
 ==== Notes ==== ==== Notes ====