FoxInCloud
awolepdfxc
Gravatar is a globally recognized avatar based on your email address. awolepdfxc
  Vincent H.
  All
  Jan 9, 2020 @ 08:24am

Hi all,

I am trying to display a pdf with awolepdfxc. I load the file as follows:

THISFORM.OlepDF.Tag = "Temp\Test1.pdf"

Blank screen.

I had tried before with an absolute path:

THISFORM.OlepDF.Tag = "C:\Temporaire\Test1.pdf"

Not better with:

THISFORM.OlepDF.Tag = filetostr ("C:\Temporaire\Test1.pdf")

Tag and Visible are saved.

What did i miss?
Thank you in advance

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Gilles Lajot-Sarthou
  Vincent H.
  Jan 9, 2020 @ 09:07am

Bonjour Vincent awolepdfxc's classe need PDFXChanger-viewer (from Trackers Software), installed on the pc to be used..

Cordialement Gilles

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  Gilles Lajot-Sarthou
  Jan 9, 2020 @ 09:17am

Merci Gilles !

But it seems to me that it is installed by default with FIC.

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Gilles Lajot-Sarthou
  Vincent H.
  Jan 9, 2020 @ 10:48pm

Bonjour Vincent,

PDF-XChange Viewer is not installed by FoxInCloud, only the class to be used with the PDF-XChange active-X..

I use an old PDF-XChange Viewer, but you can download the new one in http://www.pdfxchange.fr/

Cordialement Gilles

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  Gilles Lajot-Sarthou
  Jan 9, 2020 @ 11:40pm

Bonjour Gilles,

Thanks for your new response.

It all seems a bit old to me and I wonder if it's not better to use the <embed> tag

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jan 10, 2020 @ 12:02am

Hi Vincent,

You may want to set a breakpoint in awOLEPDFxc.tag_assign() and share what happens.

I suspect your file either can't be found or is invalid.

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jan 10, 2020 @ 12:13am

Thanks Thierry,

I prefer this way. Here is the result:

What do you think about ?

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jan 10, 2020 @ 01:51am

looks nice! do you want to share your code?

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jan 10, 2020 @ 11:59pm

It's very simple (I just added wcSCR in my class):

TEXT TO THIS.wcHTML TEXTMERGE NOSHOW FLAGS 1 PRETEXT 3
  <div class="embed-responsive embed-responsive-4by3" id="<<THIS.wcID>>">
     <iframe class="embed-responsive-item" src="<<THIS.wcSCR>>"></iframe>
  </div>
ENDTEXT
Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  Vincent H.
  Jan 11, 2020 @ 10:28am

Comparison of 2 PDF

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jan 12, 2020 @ 10:49pm

cool, thanks for sharing!

For safety reasons, make sure that the PDF in the site's temp folder has a unique name (different across users)

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jan 13, 2020 @ 03:55am

OK, thanks Thierry

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Arcadio Bianco
  Vincent H.
  Jan 14, 2020 @ 06:55am

Hello! That sounds pretty interesting to me. What do I need to do to deploy this? Use awolpdfxc class?

Thanks!

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  Arcadio Bianco
  Jan 14, 2020 @ 09:45am

Hi Arcadio,

No, just the simple code above.

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Arcadio Bianco
  Vincent H.
  Jan 14, 2020 @ 11:14am

Yes that I understood. But like where did you set the PDF? Which FIC classes did you use?

Thanks!

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  Arcadio Bianco
  Jan 15, 2020 @ 01:15am

No classe.

Just (relative) path:
scr="temp/my_pdf_file.pdf"

You only need to copy your file to temp folder, with unique name as Thierry reminds us

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Gilles Lajot-Sarthou
  Vincent H.
  Jan 20, 2020 @ 11:44pm

Hi Vincent I tried to use your method of viewing a PDF. I have:

  • added in an form an OLE object based on the awOLEIE class
  • added the following code in the wcGenHTML method of this object
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} doc in Parent Code {fr} doc in parent code

WITH m.THIS
   TEXT TO .wcHTML TEXTMERGE NOSHOW FLAGS 1 PRETEXT 3
     <div class = "embed-responsive embed-responsive-4by3" id = "<<. wcID >>">
        <iframe class = "embed-responsive-item" src = "<< m.THISFORM.cFilePDF >>"> </iframe>
     </ Div>
   endText
ENDWITH
  • added in the INIT () method of the form the following code which assigns the name of the PDF file to display to the THISFORM.cFilePDF property
LPARAMETERS p_file AS STRING, p_message AS STRING

=DODEFAULT()
IF VARTYPE(m.p_file) == 'C' AND NOT EMPTY(m.p_file) AND FILE(m.p_file)
	* Si l'adresse du fichier change
	THISFORM.cFilePdf = m.p_file
	IF VARTYPE(m.p_message) == 'C' AND NOT EMPTY(m.p_message)
		=THISFORM.wMessageBox('', m.p_message, 64, 'Informations', 10000)
	ENDIF
ENDIF

But the PDF does not appear in the form ?? What did I forget to do?

D'avance merci Vincent.. Cordialement

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  FoxInCloud Support - Thierry N.
  Gilles Lajot-Sarthou
  Jan 21, 2020 @ 12:05am

Hi Gilles,

this answer may help you

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Gilles Lajot-Sarthou
  FoxInCloud Support - Thierry N.
  Jan 21, 2020 @ 01:32am

Bonjour Thierry,

local lcFile, lcFile_
lcFile = 'myReport_' + thisForm.wcUserID + '.pdf'`
lcFile_ = addbs (thisForm.woConfig.cTempPathPhysical) + m.lcFile
&& build m.lcFile_
this.wcScr = thisForm.woConfig.cTempPathVirtual + m.lcFile + '?' + sys (2015)


  • What is m.lcFile_ used for? (in this.wcScr = thisForm.woConfig.cTempPathVirtual + m.lcFile + '?' + sys (2015) m.lcFile is used)

  • In my example if my file in THISFORM.cFilePDF contains a unique file name like _SCREEN.locale + TTOC (DATETIME (), 1) + "order_gw" + ALLTRIM (SUBSTR (SYS (2015), 3, 10)) + TRANSFORM (_VFP.PROCESSID) + '.pdf', what is + '?' + sys (2015) in this.wcScr = thisForm.woConfig.cTempPathVirtual + m.lcFile + '?' + sys (2015)

  • is it imperative that the PDF file is in the thisForm.woConfig.cTempPathPhysical sub-folder?

  • should the responsive-embeded.less css classes be copied to the xxx.css file?

Amicalement Gilles

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  FoxInCloud Support - Thierry N.
  Gilles Lajot-Sarthou
  Jan 21, 2020 @ 06:53am

What is m.lcFile_ used for? (in this.wcScr = thisForm.woConfig.cTempPathVirtual + m.lcFile + '?' + sys (2015) m.lcFile is used)

In my code sample m.lcFile_ holds fullpath(m.lcFile). It is the address you'll build the file into.

what is + '?' + sys (2015) in this.wcScr = thisForm.woConfig.cTempPathVirtual + m.lcFile + '?' + sys (2015)

If you always use the same name for the same file and user, '?' + sys (2015) makes sure the browser will reload the file from the server rather than from its cache.

is it imperative that the PDF file is in the thisForm.woConfig.cTempPathPhysical sub-folder?

thisForm.woConfig.cTempPathPhysical is the physical path for the site's Temp/ directory; so if you want to serve the file from the site's temp folder, you need to store it into thisForm.woConfig.cTempPathPhysical

should the responsive-embeded.less css classes be copied to the xxx.css file?

Vincent may know better than me … I would say no, these classes are defined in bootstrap.css; you can search the class names in this file.

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jan 21, 2020 @ 07:21am

Hi Gilles,

I confirm, it's not necessary to copy anything in your xxx.css file.

But this parameter is useful for the layout (height):

#yourform_scx .embed-responsive-4by3 {
  padding-bottom: xx%;
}

Bien cordialement,

Vincent

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Gilles Lajot-Sarthou
  Vincent H.
  Jan 22, 2020 @ 03:36am

Hi Vincent and Thierry,

After many tests here is what I found:

The name of the PDF file displayed using the OLE-IE object and the OLE-IE.wcHTMLGen () method cannot be changed by programming.

It should always be the same ..

Whenever I have modified the value of OLE-IE.wcSRC from a form method to change the name of the PDF, the display in iFrame remains that of the PDF declared in the OLE-IE.wcSRC class.

Using the wcHTMLGen method of an OLE-IE object to display a PDF in an iFRAME on a form seem to be a good idea.

BUT, the wcSRC property added in the class of the OLE-IE object which is used to store the WEB path of the PDF file to display, cannot be modified from a method of the form (for example form.init ()) which has this object OLE-IE

.. even by indicating in the class of the OLE-IE object wcPropSave = 'wcSRC' to allow FIC to save / restore the value of OLE-IE.wcSRC ..

This therefore implies that the PDF file to be displayed in Iframe always has the same name.

What did i miss?

What did I forget to do?

D'avance merci.. Cordialement

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  Gilles Lajot-Sarthou
  Jan 22, 2020 @ 05:29am

Hi Gilles,

I think it's simpler.

In an editboxcontrol, just add a property named wcSCR and:

wcHTMLgen()
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} doc in Parent Code {fr} doc dans le code parent
*!*      <div class="embed-responsive embed-responsive-16by9">
*!*        <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
*!*      </div>
WITH THIS
   TEXT TO .wcHTML TEXTMERGE NOSHOW FLAGS 1 PRETEXT 3
     <div class="embed-responsive embed-responsive-4by3" id="<<.wcID>>">
        <iframe class="embed-responsive-item" src="<<.wcSCR>>?<<SYS(2015)>>"></iframe>
     </div>
   ENDTEXT
ENDWITH

Refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method
IF EMPTY (THIS.wcID)
   RETURN
ENDIF
WITH THISFORM
   IF .wBSlHTMLgen
      THIS.wcHTMLgen
      .wcScriptJSadd(TEXTMERGE([jQuery('#<<THIS.wcID>>').html(<<cLitteralJS(THIS.wcHTML)>>);]))
   ENDIF
ENDWITH

Bien à toi, Vincent

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Gilles Lajot-Sarthou
  Vincent H.
  Jan 22, 2020 @ 08:19am

Thank you Vincent,

I was missing the JS/HTML script refresh logic ..

thisForm.woConfig.cTempPathPhysical generates an error code when I want to use it to deposit my PDF file in the temporary directory of the site.

'index_scx.my_cntslogan.btnconnect.Clickinet ()': Method or procedure init (): error n ° 1925 ("Unknown member WOCONFIG") in line n ° 16 ("cCopie = ADDBS (thisForm.woConfig.cTempPathPhysical) +" PDFOLEIE.pdf "")

How do you use this directory to store your files?

Encore merci!

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Vincent H.
  Gilles Lajot-Sarthou
  Jan 22, 2020 @ 08:40am

For example, with a control using my class:

.Embed.Refresh()
LOCAL oServer as xxxServer OF xxxServer.prg, oConfig as xxxAppConfig OF xxxServer.prg, Mfichier
wlWeb(@m.oServer, @m.oConfig)
Mfichier = "\My_path\Fichier.pdf"
COPY FILE (m.Mfichier) TO ADDBS (m.oConfig.cTempPathPhysical) + "Fichier_Numero_dossier.pdf"
THIS.wcSCR = "temp/Fichier_Numero_dossier.pdf"
DODEFAULT()

A charge de revanche ...

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Gilles Lajot-Sarthou
  Vincent H.
  Jan 22, 2020 @ 08:50am

Merci,

Excellent!

A charge de revanche!

Gravatar is a globally recognized avatar based on your email address. re: awolepdfxc
  Gilles Lajot-Sarthou
  Gilles Lajot-Sarthou
  Jan 23, 2020 @ 06:26am

Hi, Using an iFrame to show a PDF into a browser is a good idea with Chrome, Firefox but not with IE11..

Regards

© 1996-2020