Page 1 of 1

For some reason, in Windows-10, the DC_PrintPreviewAcrobat() command does not show the pdf file

Posted: Thu Sep 08, 2022 1:06 am
by Eugene Lutsenko
Hi!
For some reason, in Windows-10, the DC_Print Preview Acrobat() command does not show the pdf file. At the same time, no error messages or others are issued

Re: For some reason, in Windows-10, the DC_PrintPreviewAcrobat() command does not show the pdf file

Posted: Thu Sep 08, 2022 7:28 am
by rdonnay
This is a very old function that required the Acrobat OCX (ActiveX control) be installed on the computer.

I suggest that you just use DC_SpawnUrl(<cPdfFile>).

Re: For some reason, in Windows-10, the DC_PrintPreviewAcrobat() command does not show the pdf file

Posted: Thu Sep 08, 2022 1:43 pm
by Eugene Lutsenko
Hi, Roger! Thank you for answering. Unfortunately, under Windows-10, this DC_SpawnUrl(<cPdfFile>) function works exactly the same as DC_PrintPreviewAcrobat(). I tried to specify the path to the pdf file and short (only the file name) and full (disk + all folders + file name). It works the same way: it does not write or display anything. Under Windows-7, the new version works well, just like the old one

Re: For some reason, in Windows-10, the DC_PrintPreviewAcrobat() command does not show the pdf file

Posted: Thu Sep 08, 2022 2:23 pm
by rdonnay
You need to install Acrobat Reader on your Windows 10 computer.

Re: For some reason, in Windows-10, the DC_PrintPreviewAcrobat() command does not show the pdf file

Posted: Thu Sep 08, 2022 11:41 pm
by skiman
Hi,

Maybe you can try this.

Code: Select all

cPdfFile := "xxx.pdf"
DllCall( "Shell32.dll"   , DLL_STDCALL, ; 
	"ShellExecuteA", 0, Chr(0), cPdfFile , Chr(0), Chr(0), 3)
If this doesn't work, there is something missing on your system. With the above it just opens the cFile with the application defined in your windows, which is the same when using DC_SpawnUrl().

Re: For some reason, in Windows-10, the DC_PrintPreviewAcrobat() command does not show the pdf file

Posted: Fri Sep 09, 2022 3:41 am
by Victorio
Hi Eugene,

I am opening PDF files simply with Runshell()

RunShell(pathpdf+filepdf,pathtopdfviewer,.t.,.f.)

and pathtopdfviewer I found in registry :

pathtopdfviewer:=DC_Regquery(HKEY_CLASSES_ROOT,"Software\Adobe\Acrobat\Exe")
if Valtype(pathtopdfviewer) # 'C' .OR. Empty(pathtopdfviewer)
oznam("Upozornenie : nainštalujte Acrobat Reader, inak nebude možné zobrazovať PDF súbory")
else
pathtopdfviewer=strtran(pathtopdfviewer,["])
endif

look also to modify path with strtran

Acrobat Reader can be in different directories in Windows 7 or Windows 10.

For printing I use SumatraPDF, because there is better select parameter to printer.

Re: For some reason, in Windows-10, the DC_PrintPreviewAcrobat() command does not show the pdf file

Posted: Sun Sep 11, 2022 2:24 am
by Eugene Lutsenko
Victorio wrote: Fri Sep 09, 2022 3:41 am Hi Eugene,

I am opening PDF files simply with Runshell()

RunShell(pathpdf+filepdf,pathtopdfviewer,.t.,.f.)

and pathtopdfviewer I found in registry :

pathtopdfviewer:=DC_Regquery(HKEY_CLASSES_ROOT,"Software\Adobe\Acrobat\Exe")
if Valtype(pathtopdfviewer) # 'C' .OR. Empty(pathtopdfviewer)
oznam("Upozornenie : nainštalujte Acrobat Reader, inak nebude možné zobrazovať PDF súbory")
else
pathtopdfviewer=strtran(pathtopdfviewer,["])
endif

look also to modify path with strtran

Acrobat Reader can be in different directories in Windows 7 or Windows 10.

For printing I use SumatraPDF, because there is better select parameter to printer.
My dear colleagues! Option c SumatraPDF-3.4.5-32.exe (portable) I liked it the most, because it does not depend on the Windows version at all and from what is installed or not installed under Windows. I just put SumatraPDF-3.4.5-32.exe in the folder with the system, I replaced everywhere in the text of the system: a command like DC_PrintPreviewAcrobat( CFile, '6.3. Advanced decision-making algorithm of ASC-analysis') with RunShell(file,"SumatraPDF-3.4.5-32.exe ",.T.). The Sumatra PDF program itself is made very pleasantly, with taste. A good program. Everything works fine! Thank you all very much!