Impresion PDF en espejo (Solucionado)

Impresion PDF en espejo (Solucionado)

Postby cmsoft » Mon Dec 03, 2018 3:18 pm

Estimados:
Tengo un problema al emitir un PDF desde el Preview con PRINT. Me sale en espejo como muestra la figura
Image
El programa para emitir el reporte es el siguiente
Code: Select all  Expand view

STATIC FUNCTION Recaudo(cEan,cNumRef,nImporte,dFechaMax)
LOCAL oPrn, oFont1, oFont2, oFont3

     
  AddFontResource( "Bar25ifh.ttf" )
  DEFINE FONT oFont1 NAME "TAHOMA"          SIZE -24, 48  OF oPrn
  DEFINE FONT oFont2 NAME "Arial"           SIZE -24, 48  BOLD OF oPrn      


   PRINT oPrn NAME "Recaudo" PREVIEW
      PAGE
         @ 1.0, 1   PRINT TO oPrn TEXT "Codigo EAN:" ;
              SIZE 3,.5 CM FONT oFont1 ALIGN "R"
         @ 1.0, 4.1 PRINT TO oPrn TEXT cEan ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"
         @ 1.5, 1   PRINT TO oPrn TEXT "Referencia:" ;
              SIZE 3,.5 CM FONT oFont1 ALIGN "R"
         @ 1.5, 4.1 PRINT TO oPrn TEXT cNumRef ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"
         @ 2.0, 1   PRINT TO oPrn TEXT "Importe:" ;
              SIZE 3,.5 CM FONT oFont1 ALIGN "R"
         @ 2.0, 4.1 PRINT TO oPrn TEXT STR(nImporte,12,2) ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"
         @ 2.5, 1   PRINT TO oPrn TEXT "Fecha pago:" ;
              SIZE 3,.5 CM FONT oFont1 ALIGN "R"
         @ 2.5, 4.1 PRINT TO oPrn TEXT DTOC(dFechaMax) ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"         
         
      ENDPAGE      
   ENDPRINT

   oFont1:End()      // Destroy the font object
   oFont2:End()      // Destroy the font object  

RETURN NIL
 


Alguna pista del porque?
Gracias de antemano
Last edited by cmsoft on Mon Dec 10, 2018 8:53 pm, edited 1 time in total.
User avatar
cmsoft
 
Posts: 1220
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Impresion PDF en espejo

Postby karinha » Mon Dec 03, 2018 4:13 pm

César, mira aqui, que fantástico:

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

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

Re: Impresion PDF en espejo

Postby cmsoft » Mon Dec 03, 2018 6:08 pm

Hola Karinha, si eso codigo se lo pase yo a Francisco.
El tema es cuando pongo exportar a PDF con el boton del PREVIEW. Me genera el PDF pero con el texto en espejo.
User avatar
cmsoft
 
Posts: 1220
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Impresion PDF en espejo

Postby karinha » Mon Dec 03, 2018 6:53 pm

César:

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

Re: Impresion PDF en espejo

Postby karinha » Mon Dec 03, 2018 6:56 pm

César:

Code: Select all  Expand view

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL cEan,cNumRef,nImporte,dFechaMax

   cEan      := "534140083583"
   cNumRef   := "835831528"
   nImporte  := 3853.88
   dFechaMax := DATE()

   Recaudo( cEan, cNumRef, nImporte, dFechaMax )

RETURN NIL

FUNCTION Recaudo( cEan, cNumRef, nImporte, dFechaMax)

   LOCAL oPrn, oFont1, oFont2, oFont3

   // AddFontResource( "Bar25ifh.ttf" )
   AddFontResource( "EAN-13.TTF" )  // TESTE PARA CESAR

   PRINT oPrn NAME "Recaudo" PREVIEW MODAL

      DEFINE FONT oFont1 NAME "Bar 25i f HR"  SIZE  14, 00  OF oPrn
      DEFINE FONT oFont2 NAME "Arial"         SIZE -14, 00  BOLD OF oPrn

      PAGE
         @ 1.0, 1   PRINT TO oPrn TEXT "Codigo EAN:" ;
              SIZE 3,.5 CM FONT oFont1 ALIGN "R"

         @ 1.0, 4.1 PRINT TO oPrn TEXT cEan ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"

         @ 1.5, 1   PRINT TO oPrn TEXT "Referencia:" ;
              SIZE 3,.5 CM FONT oFont1 ALIGN "R"

         @ 1.5, 4.1 PRINT TO oPrn TEXT cNumRef ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"

         @ 2.0, 1   PRINT TO oPrn TEXT "Importe:" ;
              SIZE 3,.5 CM FONT oFont1 ALIGN "R"

         @ 2.0, 4.1 PRINT TO oPrn TEXT STR(nImporte,12,2) ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"

         @ 2.5, 1   PRINT TO oPrn TEXT "Fecha pago:" ;
              SIZE 3,.5 CM FONT oFont1 ALIGN "R"

         @ 2.5, 4.1 PRINT TO oPrn TEXT DTOC(dFechaMax) ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"
         
      ENDPAGE      

   ENDPRINT

   oFont1:End()      // Destroy the font object
   oFont2:End()      // Destroy the font object

   // RemoveFontResource( "Bar25ifh.ttf" )
   RemoveFontResource( "EAN-13.ttf" )

RETURN NIL
 


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

Re: Impresion PDF en espejo

Postby karinha » Mon Dec 03, 2018 7:15 pm

César,

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

Re: Impresion PDF en espejo

Postby karinha » Mon Dec 03, 2018 7:16 pm

César, con el Código de Barras:

Code: Select all  Expand view

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL cEan,cNumRef,nImporte,dFechaMax

   cEan      := "534140083583"
   cNumRef   := "835831528"
   nImporte  := 3853.88
   dFechaMax := DATE()

   Recaudo( cEan, cNumRef, nImporte, dFechaMax )

RETURN NIL

FUNCTION Recaudo(cEan,cNumRef,nImporte,dFechaMax)

   LOCAL oPrn, oFont1, oFont2, oFont3

   AddFontResource( "Bar25ifh.ttf" )
   // AddFontResource( "EAN-13.TTF" )  // TESTE PARA CESAR

   PRINT oPrn NAME "Recaudo" PREVIEW MODAL

      DEFINE FONT oFont1 NAME "Bar 25i f HR"  SIZE  14, 00  OF oPrn
      DEFINE FONT oFont2 NAME "Arial"         SIZE -14, 00  BOLD OF oPrn

      PAGE
         @ 1.0, 1   PRINT TO oPrn TEXT "Codigo EAN:" ;
              SIZE 3,.5 CM FONT oFont2 ALIGN "R"

         @ 1.0, 4.1 PRINT TO oPrn TEXT cEan ;
                  SIZE 6,.5 CM FONT oFont1 ALIGN "L"

         @ 1.5, 1   PRINT TO oPrn TEXT "Referencia:" ;
              SIZE 3,.5 CM FONT oFont2 ALIGN "R"

         @ 1.5, 4.1 PRINT TO oPrn TEXT cNumRef ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"

         @ 2.0, 1   PRINT TO oPrn TEXT "Importe:" ;
              SIZE 3,.5 CM FONT oFont2 ALIGN "R"

         @ 2.0, 4.1 PRINT TO oPrn TEXT STR(nImporte,12,2) ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"

         @ 2.5, 1   PRINT TO oPrn TEXT "Fecha pago:" ;
              SIZE 3,.5 CM FONT oFont2 ALIGN "R"

         @ 2.5, 4.1 PRINT TO oPrn TEXT DTOC(dFechaMax) ;
                  SIZE 6,.5 CM FONT oFont2 ALIGN "L"
         
      ENDPAGE      

   ENDPRINT

   oFont1:End()      // Destroy the font object
   oFont2:End()      // Destroy the font object

   RemoveFontResource( "Bar25ifh.ttf" )
   // RemoveFontResource( "EAN-13.ttf" )

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

Re: Impresion PDF en espejo

Postby cmsoft » Tue Dec 04, 2018 4:16 am

Gracias Karinha por todas las pruebas, pero tengo el mismo resultado con tu código.
Con el preview se ve asi:
Image
Con el pdf generado con el preview se ve asi:
Image

En esta PC no tengo instalado ni el Acrobat ni el CutePDF ni ningun administrador de archivos PDF.
Cuando instalo en clientes que no tienen esos programas es el problema.
User avatar
cmsoft
 
Posts: 1220
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Impresion PDF en espejo

Postby karinha » Tue Dec 04, 2018 11:12 am

Instale una impresora virtual, por ejemplo:

https://www.pdfmachine.com/

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

Re: Impresion PDF en espejo

Postby cmsoft » Tue Dec 04, 2018 11:24 am

Si, esa es un solución, pero lo clientes tiene que hacer lo mismo y elegir la impresora virtual como salida cuando quieren exportar a PDF. Y como el Preview tiene la opcion de exportar a PDF es raro que nadie haya tenido este problema no?
User avatar
cmsoft
 
Posts: 1220
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Impresion PDF en espejo

Postby karinha » Tue Dec 04, 2018 12:48 pm

No comprendo, por cual razón no instalar el Adobe Acrobat Reader DC?

https://get.adobe.com/br/reader/

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

Re: Impresion PDF en espejo

Postby cmsoft » Tue Dec 04, 2018 1:59 pm

Porque el sistema que entrego lo distribuyo en forma de instalador descargando de la web, y de esa manera dependo de que el cliente que lo descarga (que es un proceso automatico del que no tengo intervesion) tenga instalado el Acrobat Reader.. (u otro similar).
User avatar
cmsoft
 
Posts: 1220
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Impresion PDF en espejo

Postby karinha » Tue Dec 04, 2018 2:41 pm

Mira se comprende. Adapta a tu sistema.

Code: Select all  Expand view

FUNCTION ShowPDF_READER( cAlias )

   LOCAL oWndPdf, oPdf, cTmp, NFEVisualSUM, nNumNfeSUM, nRecNo, oTaskP

   nRecNo     := ( cAlias )->( RecNo() ) //-> CCE.DBF
   GoTo( nRecNo )

   nNumNfeSUM := VAL( SUBSTR( ( cAlias )->CHAVE, 29, 6 ) )

   NFEVisualSUM := "C:\NFEPDF\"+"CCE"+ALLTRIM( STR( nNumNfeSUM ) )+".PDF"

   /*
   MsgWait( "
LOCALIZANDO O ARQUIVO DA CARTA DE CORRECAO", ;
            "
AGUARDE UM MOMENTO POR FAVOR...           ", 2.5 )
   */

   // USANDO ADOBE READER DIRETO VIA CODIGO - ACTIVEX DO FWH17.01
   IF .NOT. FILE( NFEVisualSUM )  

      ? "
Arqchivo no localizado"

      RETURN NIL

   ENDIF

   DEFINE WINDOW oWndPdf TITLE "
FiveWin ActiveX Support - Visualizar/Imprimir o *.PDF Usando o Adobe Reader"

   oPdf = TActiveX():New( oWndPdf, "
AcroPDF.PDF.1" , 1, 1, 20, 50 )

   oWndPdf:oClient := oPdf

   oPdf : src = NFEVisualSUM

   // Mostra Preview Pequeno no lado esquerdo da tela...
   // oPdf:Do( "
SetPageMode", "thumbnail and pages" )

   oPdf:SetProp( "
Src", cTmp )

   oPdf:Do( "
LoadFile", Lfn2Sfn(cTmp) )

   oPdf:Do( "
GetVersions" )

   oPdf:Do( "
SetCurrentPage", 1 )

   // oPdf:Print() // Nao funciona direto na impressora..
   // oPdf:Do( "
PrintAll" )  // Assim funciona. pede a impressao

   // Mostra a Barra de Botoes do ADOBE READER
   oPdf:Do( "
SetShowToolbar", .T. )

   // Liga/Desliga barra de Scroll do lado direto do Adobe Reader
   oPdf:Do( "
SetShowScrollbars", .T. )  // Liga/Desliga Scroll

   ACTIVATE WINDOW oWndPdf MAXIMIZED      ;
            ON INIT( PDFActivex( oPdf ) ) ;
            VALID( oWndPdf := NIL, oPdf:End(), .T. )

RETURN NIL

FUNCTION PDFActivex( MyProgID )

   LOCAL adretor := .T.
 
   if IsActivex( "
PDF.PdfCtrl.1" ); MyProgID := "PDF.PdfCtrl.1"; endif
   if IsActivex( "
PDF.PdfCtrl.2" ); MyProgID := "PDF.PdfCtrl.2"; endif
   if IsActivex( "
PDF.PdfCtrl.3" ); MyProgID := "PDF.PdfCtrl.3"; endif
   if IsActivex( "
PDF.PdfCtrl.4" ); MyProgID := "PDF.PdfCtrl.4"; endif
   if IsActivex( "
PDF.PdfCtrl.5" ); MyProgID := "PDF.PdfCtrl.5"; endif
   if IsActivex( "
PDF.PdfCtrl.6" ); MyProgID := "PDF.PdfCtrl.6"; endif
   if IsActivex( "
PDF.PdfCtrl.7" ); MyProgID := "PDF.PdfCtrl.7"; endif
   if IsActivex( "
acroPDF.PDF.1" ); MyProgID := "acroPDF.PDF.1"; endif
   if IsActivex( "
acroPDF.PDF.2" ); MyProgID := "acroPDF.PDF.2"; endif

   IF Empty( MyProgID )

      MsgInfo( "
PDF Activex não instalado !!!"+CRLF+ ;
               "
É necessário que seja instalado o programa ADOBE READER, consulte o suporte do sistema.",.F.)

      adretor := .F.

   ENDIF

RETURN(adretor)


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

Re: Impresion PDF en espejo

Postby cmsoft » Wed Dec 05, 2018 11:40 am

Hola Karinha: Gracias por tu interes. La idea es poder generar el PDF sin tener el Acrobat Reader ni ningun otro complemento instalado, y que lo genere sin el efecto espejo.
User avatar
cmsoft
 
Posts: 1220
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Impresion PDF en espejo

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

Code: Select all  Expand view

   LOCAL cFile

   nPDF := 1 // 2 3 4 5 6

   cFile := "C:\MYPDF\"+"MYPDF"+ALLTRIM( nPDF )+".PDF"

   PRINT oPrn NAME "
MYPDF" FILE cFile

Ó

   FWSavePreviewToPDF( oPrn )  // Esta en: PRV2PDF.PRG do Five.


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

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: FranciscoA, Google [Bot] and 72 guests