Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CGJQPDFViewer help needed
#4
(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 Smile

// 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;
Reply


Messages In This Thread
CGJQPDFViewer help needed - by lfeliz - 11-16-2024, 06:51 PM
RE: CGJQPDFViewer help needed - by lfeliz - 11-17-2024, 07:04 PM
RE: CGJQPDFViewer help needed - by lfeliz - 01-15-2025, 09:15 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)