01-15-2025, 09:15 PM
(01-02-2025, 05:48 PM)FrancescoSgaravatti Wrote: Hi,
I also have a similar problem, I would like to use this component to view a file present on the PC where the application resides (Stand alone) and I tried the instruction like:
IWCGJQPdfViewer1->JQPDFViewerOptions->PDFFileName = "PDF_Example.pdf";
But I get a result like this
PDF.js v1.10.88 (build: c62a1938)
Message: Missing PDF "http://localhost/PDF_Example.pdf?cache=1735839201467".
Can someone help me to use this object?
Hello, I finally go this working by using the Cache , see snippet below . I also switched using the TIWURLWindow as my documents are more than just PDF.
Hope this helps

// Determine the mime type
if s2 = '.PDF' then
s1 := 'application/pdf'
else if s2 = '.PNG' then
s1 := 'image/png'
else if s2 = '.JPEG' then
s1 := 'image/jpeg'
else if s2 = '.JPG' then
s1 := 'image/jpeg'
else if s2 = '.BMP' then
s1 := 'image/bmp'
else if s2 = '.TIF' then
s1 := 'image/tiff'
else if s2 = '.TIFF' then
s1 := 'image/tiff'
else
s1 :='';
// Get URL to cache
href := TIWAppCache.AddFileToCache(self,s0,s1,ctSession);
// Set the URL to view doc
URLWin.URI := href;

