FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour WORD O PDF?
Posts: 39
Joined: Tue Mar 26, 2013 02:09 PM
WORD O PDF?
Posted: Wed Jul 08, 2015 07:01 PM
Estimados

Necesito crear desde mi sistema un documento en WORD o PDF el cual incluya imagenes y datos extraidos desde el sistema y no se como comenzar. es una especie de CERTIFICADO o DIPLOMA

Alguien me puede orientar?

Agradecido!!!
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: WORD O PDF?
Posted: Wed Jul 08, 2015 07:14 PM

Busca en el foro: Word.Application

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: WORD O PDF?
Posted: Wed Jul 08, 2015 11:03 PM

Si tienes una versión reciente de FWH podrías dibujarlo con la clase Printer y salvarlo como archivo pdf.

Saludos

Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: WORD O PDF?
Posted: Thu Jul 09, 2015 12:42 PM
Una forma muy basica pero util, seria que crees el diploma con un graficador en jpg y luego le completes los datos de tu sistema, usando como dice Horacio, la clase print.
Ejemplo:
Code (fw): Select all Collapse
#include "Fivewin.ch"
STATIC FUNCTION PrintDiploma()
LOCAL oPrn, oFont
   DEFINE FONT oFont NAME "COURIER NEW" SIZE -40,80
   PRINT oPrn NAME "Diploma" PREVIEW MODAL
   PAGE
    oPrn:SayImage(0,0, "diploma.jpg", oPrn:nHorzRes(), oPrn:nVertRes() ,   nil, .t. )
    oPrn:Say( 100,100 , MiTabla->nombre,oFont )
    oPrn:Say( 200,100 , MiTabla->titulo,oFont)
    .... // Y todos los datos que quieras agregar
   ENDPAGE
   ENDPRINT
RETURN nil

Una vez que lo tienes en el Preview, lo puedes grabar el usuario final como Word o Pdf con el mismo preview
Espero te sirva
Posts: 39
Joined: Tue Mar 26, 2013 02:09 PM
Re: WORD O PDF?
Posted: Thu Jul 09, 2015 03:14 PM

MUCHACHOS MUCHAS GRACIAS!!!!

Lamentablemente no tengo la versión mas nueva.... Pero me quedo muy claro.

Muchas gracias.

Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: WORD O PDF?
Posted: Thu Jul 09, 2015 04:36 PM
corel.prg, de la carpeta samples de fwh creo recordar que esta aun en versiones viejisimas.

Code (fw): Select all Collapse
// Using CorelDraw to generate printing templates!!!

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   LOCAL oPrn, oFont, oIni, oPrinter

   PRINTER oPrn PREVIEW

      DEFINE FONT oFont NAME "Times New Roman" SIZE 0,-12 OF oPrn

      PAGE

      #ifdef __CLIPPER__
         oPrn:ImportWMF( "Invoice.Wmf" )
      #else   
         oPrn:ImportWMF( "Invoice.emf" )
      #endif   

      oPrn:CmSay(  2.1,   16, "19960001")             // invoice
      oPrn:CmSay(  4.3,  1.7, "Computer Associates")  // company name
      oPrn:CmSay(  5.5,  1.7, "Somewhere in U.S.A.")  // adress
      oPrn:CmSay(  7  ,  1.7, "0001")                 // reference
      oPrn:CmSay(  7  ,  4.2, "Software consulting")  // description
      oPrn:CmSay(  7  , 18.5, "0")                    // price
      oPrn:CmSay( 16  , 18.5, "0")                    // total

      ENDPAGE

      PAGE

      #ifdef __CLIPPER__
         oPrn:ImportWMF( "Invoice.Wmf" )
      #else   
         oPrn:ImportWMF( "Invoice.emf" )
      #endif   

      oPrn:CmSay(  2.1,   16, "19960002")              // invoice
      oPrn:CmSay(  4.3,  1.7, "Microsoft Corporation") // company name
      oPrn:CmSay(  5.5,  1.7, "Somewhere in U.S.A.")   // adress
      oPrn:CmSay(  7  ,  1.7, "0002")                  // reference
      oPrn:CmSay(  7  ,  4.2, "Another test")          // description
      oPrn:CmSay(  7  , 18.5, "0")                     // price
      oPrn:CmSay( 16  , 18.5, "0")                     // total

      ENDPAGE

   ENDPRINT

   oFont:End()

   MsgInfo( "Work done!", "Look at your printer" )

return nil

//----------------------------------------------------------------------------//
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)

Continue the discussion