Impresion PDF en espejo (Solucionado)

Re: Impresion PDF en espejo

Postby karinha » Wed Dec 05, 2018 12:38 pm

Code: Select all  Expand view

#include "fivewin.ch"

function Main()

   TPreview():bSaveAsPDF := { | oPreview | FWSavePreviewToPDF( oPreview ) }

   XBrowse( "CUSTOMER.DBF" )

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

Re: Impresion PDF en espejo

Postby karinha » Wed Dec 05, 2018 12:40 pm

Code: Select all  Expand view

// Generate a PDF from a PRINTER object without preview

#include "FiveWin.ch"

function Main()

   local oPrn

   PRINT oPrn PREVIEW NAME "ORCAM"

      PAGE

      oPrn:CmSay( 2, 2, "Hello world" )

      ENDPAGE

      oPrn:lMeta = .F.

   ENDPRINT

   FWSavePreviewToPDF( oPrn )

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

Re: Impresion PDF en espejo

Postby karinha » Wed Dec 05, 2018 12:43 pm

Con harupdf creo sea el mejor.

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

Re: Impresion PDF en espejo

Postby karinha » Wed Dec 05, 2018 1:12 pm

Miara este post, donde pruebo HARUPDF con el editor SUMATRAPDF que puedes poner "invisible" en tu sistema, mui fácil de usar.

http://forums.fivetechsupport.com/viewtopic.php?f=6&t=33439

Fantastic Job.

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

Re: Impresion PDF en espejo

Postby cmsoft » Thu Dec 06, 2018 9:07 pm

Karinha:
Muchisimas gracias por tu tiempo... Voy a investigar la opcion de HARUPDF. Igualmente la idea era usar el Preview de Fivewin y que cuando genere el PDF no sea en espejo...
User avatar
cmsoft
 
Posts: 1204
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Impresion PDF en espejo

Postby Carlos Mora » Sat Dec 08, 2018 11:18 am

César,
por lo extraño del problema, y viendo que no se repite en otros equipos ¿No tendrá algo que ver la configuración de la impresora? Prueba de poner como impresora por defecto una impresora de pdf o algo así, que no tenga nada que ver con una printer real, a ver si es eso.
Puede que tu o alguien más haya usado la impresora para hacer alguna impresión de esas que se usan para transferencias, o tengas configurado como papel 'papel para transferencias' y eso esté cambiando el comportamiento.
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: Impresion PDF en espejo

Postby cmsoft » Mon Dec 10, 2018 10:52 am

Hola Carlos, gracias por responder...
He hecho las pruebas, en equipos que no tienen ninguna aplicación de manejo de PDF y es ahí donde me da el error. Es extraño porque si el reporte viene de la clase Report no tiene ese efecto, pero si viene de la clase Print ahi si da el efecto espejo. Tambien me resulta extraño que a nadie le haya dado ese efecto nunca, y que nunca se haya reportado. Tal vez pensaba que debería tener alguna consideración al utilizar la clase print, y es por eso que me da ese efecto.
User avatar
cmsoft
 
Posts: 1204
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Impresion PDF en espejo

Postby karinha » Mon Dec 10, 2018 12:45 pm

Mira en RPREVIEW.PRG

Code: Select all  Expand view

METHOD SaveAs( lPDF, cFile, lView ) CLASS TPreview

      CATCH
         lWordPDF    := .f.
//         MsgInfo( FWString( "PDF Plugin Error" ), FWString( "Information" ) )
      END
 


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

Re: Impresion PDF en espejo

Postby cmsoft » Mon Dec 10, 2018 8:51 pm

Hola Karinha!!
Otra vez gracias por tu tiempo...
Efectivamente ahi estaba el problema...
Tenia esto:
Code: Select all  Expand view

METHOD SaveAs( lPDF ) CLASS TPreview

   local oWord, nVer, oDoc
   local cFile, cExt, cMsg, lView

   if lPDF
      if ValType( ::bSaveAsPDF ) == 'B'
         return Eval( ::bSaveAsPDF, Self )
      endif
   else
      if ValType( ::bSaveAsWord ) == 'B'
         return Eval( ::bSaveAsWord, Self )
      endif
   endif

   oWord       := WinWordObj()
   if oWord == nil
      return FWSavePreviewToPDF( Self )
   endif
   nVer        := Val( oWord:Version )

   if lPDF
/*
      if nVer < 12.0
         MsgInfo( "This option requires Word 2007 or later" )
         return nil
      elseif !WordHasPDFPlugIn()
         MsgInfo( "Download and Install" + CRLF + ;
                  "SaveAsPDF plugin from" + CRLF + ;
                  "Microsoft Office Online Website" )
         return nil
      endif
*/


      if nVer >= 12.0 .and. WordHasPDFPlugIn()
         cExt  := "*.pdf"
      else
         return FWSavePreviewToPDF( Self )
      endif
   else
      cExt     := If( nVer < 12.0, "*.doc", "*.docx; *.doc" )
   endif
   cMsg        := If( lPDF, "PDF", "Doc" ) + ;
                      " File to Save( " + cExt + ") |" + cExt + "|"
   if Empty( cFile := cGetFile( cMsg, "File to Save", 1, CurDir(), , .t. ) )
      return nil
   endif
   if !( Lower( cFileExt( cFile ) ) $ cExt )
      cFile    := cFilePath( cFile ) + cFileNoExt( cFile ) + ;
                  If( lPDF, ".pdf", If( nVer < 12.0, ".doc", ".docx" ) )
   endif

   lView       := MsgYesNo( "View " + cFile + "?" )
   oDoc        := ConvertToWordDoc( Self )

   if oDoc != nil
      TRY
         oDoc:ExportAsFixedFormat( cFile, 17, lView )
      CATCH
         MsgInfo( "PDF Plugin Error" )
      END
      if lPDF
         oDoc:Close( .f. )
      else
         if nVer >= 12.0
            oDoc:SaveAs( cFile, If( Lower( cFileExt( cFile ) ) == 'doc', 0, 16 ) )
         else
            oDoc:SaveAs( cFile )
         endif
         if lView
            oDoc:Application:Visible := .t.
         else
            oDoc:Close( .f. )
         endif
      endif
   endif

return nil
 

Y en realidad iba esto:
Code: Select all  Expand view

METHOD SaveAs( lPDF, cFile, lView ) CLASS TPreview

   static lWordPDF   := .t.

   local oWord, nVer, oDoc
   local cExt, cMsg

   if lPDF
      if ValType( ::bSaveAsPDF ) == 'B'
         return Eval( ::bSaveAsPDF, Self, cFile, lView )
      elseif ! lWordPDF // tested earlier and found Word with PDF plugin not availble
         return FWSavePreviewToPDF( Self, cFile, lView )
      endif
   else
      if ValType( ::bSaveAsWord ) == 'B'
         return Eval( ::bSaveAsWord, Self, cFile, lView )
      endif
   endif

   oWord       := WinWordObj()
   if oWord == nil
      lWordPDF    := .f.
      if lPDF
        return FWSavePreviewToPDF( Self, cFile, lView )
      ELSE
        return ToWordDocViaWriter( Self, , "W" )
      Endif
   endif
   nVer        := Val( oWord:Version )

   if lPDF
      if nVer >= 12.0 .and. WordHasPDFPlugIn()
         cExt  := "*.pdf"
      else
         lWordPDF    := .f.
         return FWSavePreviewToPDF( Self, cFile, lView )
      endif
   else
      cExt = If( nVer < 12.0, "*.doc", "*.docx; *.doc" )
   endif
   cMsg    = If( lPDF, "PDF", "Doc" ) + " " + ;
             FWString( "File to Save" ) + "( " + cExt + ") |" + cExt + "|"

   if Empty( cFile ) .and. Empty( cFile := cGetFile( cMsg, FWString( "File to Save" ), 1, CurDir(), , .t. ) )
      return nil
   endif

   if !( Lower( cFileExt( cFile ) ) $ cExt )
      cFile = cFilePath( cFile ) + cFileNoExt( cFile ) + ;
              If( lPDF, ".pdf", If( nVer < 12.0, ".doc", ".docx" ) )
   endif

   DEFAULT lView := MsgYesNo( FWString( "View" ) + " " + cFile + "?", FWString( "Please select" ) )
   oDoc  = ConvertToWordDoc( Self )

   if oDoc != nil
      TRY
         oDoc:ExportAsFixedFormat( cFile, 17, lView )
      CATCH
         lWordPDF    := .f.
//         MsgInfo( FWString( "PDF Plugin Error" ), FWString( "Information" ) )
      END
      if lPDF
         oDoc:Close( .f. )
         if ! lWordPDF
            // word failed to save as PDF due to PDF Plugin Error
            return FWSavePreviewToPDF( Self, cFile, lView )
         endif
      else
         if nVer >= 12.0
            oDoc:SaveAs( cFile, If( Lower( cFileExt( cFile ) ) == 'doc', 0, 16 ) )
         else
            oDoc:SaveAs( cFile )
         endif
         if lView
            oDoc:Application:Visible := .t.
         else
            oDoc:Close( .f. )
         endif
      endif
   endif

return cFile
 

Muchas gracias por tu tiempo... Siempre muy amable con el foro..
User avatar
cmsoft
 
Posts: 1204
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Impresion PDF en espejo (Solucionado)

Postby karinha » Tue Dec 11, 2018 1:06 pm

Cmsoft, si entiendo, usted estaba usando un RPREVIEW.PRG de una versión anterior a la que se utiliza actualmente. ¿Estoy correcto?

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

Re: Impresion PDF en espejo (Solucionado)

Postby cmsoft » Tue Dec 11, 2018 7:46 pm

Asi es Karinha!
User avatar
cmsoft
 
Posts: 1204
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests