How to print PDF file without GUI?

Re: How to print PDF file without GUI?

Postby karinha » Tue Jan 12, 2021 10:47 pm

Many thanks, Rick.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7834
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: How to print PDF file without GUI?

Postby dutch » Wed Jan 13, 2021 2:28 am

Dear Master Rao & Karinha,

This code is not working. It prints unreadable text.

Thanks all.
nageswaragunupudi wrote:Can you please try this function and provide your valuable feed-back?

Code: Select all  Expand view  RUN
function PrintPDF( cPdf )

   local oWord, oDoc, lVisible

   if Empty( cPdf ) .or. !File( cPdf )
      MsgAlert( "Invalid File Name" )
      return .f.
   elseif ( oWord := WinWordObj() ) == nil
      MsgAlert( FWString( "Word not installed" ) )
      return .f.
   endif
   oWord:DisplayAlerts := .f.
   lVisible := oWord:Visible
   oWord:Visible := .f.
   oDoc  := oWord:Documents:Open( truename( cPdf ), .f., .t. )
   oDoc:PrintOut()
   oDoc:Close()
   oWord:Visible := lVisible

return .t.
 
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to print PDF file without GUI?

Postby nageswaragunupudi » Wed Jan 13, 2021 5:23 am

dutch wrote:Dear Master Rao & Karinha,

This code is not working. It prints unreadable text.

Thanks all.
nageswaragunupudi wrote:Can you please try this function and provide your valuable feed-back?

Code: Select all  Expand view  RUN
function PrintPDF( cPdf )

   local oWord, oDoc, lVisible

   if Empty( cPdf ) .or. !File( cPdf )
      MsgAlert( "Invalid File Name" )
      return .f.
   elseif ( oWord := WinWordObj() ) == nil
      MsgAlert( FWString( "Word not installed" ) )
      return .f.
   endif
   oWord:DisplayAlerts := .f.
   lVisible := oWord:Visible
   oWord:Visible := .f.
   oDoc  := oWord:Documents:Open( truename( cPdf ), .f., .t. )
   oDoc:PrintOut()
   oDoc:Close()
   oWord:Visible := lVisible

return .t.
 


Thanks for the feedback
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10648
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Surasak and 65 guests