![]() |
|
CGJQPDFViewer help needed - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: CGDevTools (https://www.atozed.com/forums/forum-27.html) +----- Thread: CGJQPDFViewer help needed (/thread-4694.html) |
CGJQPDFViewer help needed - lfeliz - 11-16-2024 I am tryng to use the CGJQPDFViewer to view a PDF file from the Cache folder. I am copying the file to the Cache and setting the I get the error in the PDF viewer : Message: Missing PDF "http://127.0.0.1:8888/$/MyApp/zHOG5EAdJuoVjqQJqQUg9W/EXP_20170525_583001.pdf?cache=1731781782136". The file acually does exist in the temporary cache folder ???? I even test that it exists before I assign the value s1 := WebApplication.UserCacheDir+ExtractFileName(UserSession.qry1DocFile.Value); s2 := webapplication.UserCacheUrlBase+ExtractFileName(UserSession.qry1DocFile.Value); if fileexists( s1)then PDFv1.JQPDFViewerOptions.PDFFileName:= s2; RE: CGJQPDFViewer help needed - lfeliz - 11-17-2024 Well, for now, the application I am working with runs on a local network or via local VPN access and is not public. So I am deploying the app on server where docs are stored and using Windows Sym Link in he wwwroot folder to make things work without the local cache until I can find a way to make that work. The PDF viewer component allows a nice embeded viewer and users dont hav eto deal with coutless windows opening up. I actually switched to using the TIWURL Window (had some non-pdf items that client need to view) and same issue. You would think you can included content from the apps temporary file cache since I have used it to send files... RE: CGJQPDFViewer help needed - FrancescoSgaravatti - 01-02-2025 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? RE: CGJQPDFViewer help needed - lfeliz - 01-15-2025 (01-02-2025, 05:48 PM)FrancescoSgaravatti Wrote: Hi, 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; |