Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Open a PDF file in a new window
#5
Hi Soren, try use IW Cache system:
Code:
procedure TIWForm5.IWGradButton1Click(Sender: TObject);
var
  xFileName: string;
  xURL: string;
begin
  // get a new temp file name. This method only returns a file name, the file  is not created
  xFileName := TIWAppCache.NewTempFileName;
  // copy a sample pdf file to our new cache file. We are just simulating a pdf file creation
  FileCopy('your_file.pdf', xFileName, True);
  // add the pdf file to the cache. cache type is defined as ctOneTime, i.e., the file will be deleted when served
  xURL := TIWAppCache.AddFileToCache(Self, xFileName, TIWMimeTypes.GetAsString(mtPDF), ctOneTime);
  // open a new window with our PDF file
  WebApplication.NewWindow(xURL);
end;
From here: https://github.com/Atozed/IntraWeb/blob/.../Unit5.pas
Reply


Messages In This Thread
Open a PDF file in a new window - by SorenJensen - 10-10-2019, 09:18 PM
RE: Open a PDF file in a new window - by kudzu - 10-11-2019, 03:41 PM
RE: Open a PDF file in a new window - by kudzu - 10-11-2019, 05:03 PM
RE: Open a PDF file in a new window - by Jose Nilton Pace - 10-11-2019, 05:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)