11-05-2021, 12:21 PM
Hi, try something like this:
Code:
// get a new temp file name. This method only returns a file name, the file is not created
System::UnicodeString xFileName = TIWAppCache::NewTempFileName();
// Generate PDF using new temp file name created above.
if (oPDFIt->Export(xFileName.c_str(), "Contents Report")) {
// add the pdf file to the cache. cache type is defined as ctOneTime, i.e., the file will be deleted when served
UnicodeString xURL = TIWAppCache::AddFileToCache(this, xFileName, TIWMimeTypes::GetAsString(mtPDF), ctOneTime);
// open a new window with your PDF file
WebApplication->NewWindow(xURL);
}
