How to print PDF file without GUI?

User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: How to print PDF file without GUI?

Post by karinha »

Many thanks, Rick.

Regards, saludos.
João Santos - São Paulo - Brasil
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to print PDF file without GUI?

Post by dutch »

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

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: How to print PDF file without GUI?

Post by nageswaragunupudi »

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

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
Post Reply