FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to print PDF file without GUI?
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: How to print PDF file without GUI?
Posted: Tue Jan 12, 2021 10:47 PM

Many thanks, Rick.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: How to print PDF file without GUI?
Posted: Wed Jan 13, 2021 02: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 (fw): Select all Collapse
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 2304 / 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)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: How to print PDF file without GUI?
Posted: Wed Jan 13, 2021 05: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 (fw): Select all Collapse
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

Continue the discussion