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

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#1 Post 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

User avatar
rdonnay
Site Admin
Posts: 4774
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

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

#2 Post 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>).
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#3 Post 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

User avatar
rdonnay
Site Admin
Posts: 4774
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

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

#4 Post by rdonnay »

You need to install Acrobat Reader on your Windows 10 computer.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1195
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

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

#5 Post 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().
Best regards,

Chris.
www.aboservice.be

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

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

#6 Post 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.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

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

#7 Post 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!

Post Reply