FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ver PDF dentro de la aplicaci贸n
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Mon Jul 04, 2016 07:55 PM

Joao, gracias
Comprobar si es un fichero de imagen v谩lido
Buen aporte, se me hab铆a olvidado esa opci贸n
Saludos

Pd.: voy a subir en un rato una nueva versi贸n con esa modificaci贸n y adem谩s ya leer谩 ficheros con caracteres utf

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: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Mon Jul 04, 2016 08:49 PM
cnavarro wrote:Joao, gracias
Comprobar si es un fichero de imagen v谩lido
Buen aporte, se me hab铆a olvidado esa opci贸n
Saludos

Pd.: voy a subir en un rato una nueva versi贸n con esa modificaci贸n y adem谩s ya leer谩 ficheros con caracteres utf


Nueva version:

Test if is a valid image file and say files with characters utf

https://bitbucket.org/fivetech/fivewin- ... explor.exe



Code (fw): Select all Collapse
#include "fivewin.ch"
#include "RichEdi5.ch"

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

REQUEST HB_CODEPAGE_ESWIN

Static oRTF
Static cRTF
Static nFilter
Static cDirName
Static aFilesTxt
Static aFilesImg
Static aFilesObj
Static aFilesAll

Static oMessage
Static oAnsi
Static oUtf8
Static oUtf16
Static oUnicode
Static oBig
Static oBom

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

function Main()

   local aImages
   local oWnd
   local oFont
   local oBrush
   local oBrw
   local nWBrw    := 300

   FW_SetUnicode( .t. )
   HB_CDPSELECT( "ESWIN" )
   HB_SETCODEPAGE( "UTF8" ) // Harbour (not xHarbour) to display unicode filenames
   SET CENTURY ON
   SET EPOCH TO 1980
   SET DATE FORMAT TO "DD/MM/YYYY"

   aFilesTxt := { "RTF", "ZIP", "TXT", "PRG", "C", "CPP", "H", "CH", "RC", "INI", "BAT", "MAK", "XML", "LOG", "PPO" }
   aFilesImg := { "BMP", "PNG", "JPG", "ICO", "DIB", "PCX", "GIF", "WMF" }
   aFilesObj := { "DOC", "XLS", "PPT", "PDF", "DOCX", "XLSX" }
   aFilesAll := { "DBF" }

   //ReadDir()
   
   nFilter  := 0
   cDirName := hb_CurDrive() + ":\" + CurDir()
   aImages  := ReadFolder()

   DEFINE FONT oFont NAME "VERDANA" SIZE 0,-14
   //DEFINE BRUSH oBrush FILE "..\bitmaps\backgrnd\stone.bmp"
   
   DEFINE WINDOW oWnd TITLE " FWExplorer: Visor de Documentos - [ TRichEdit Control ]"
   oWnd:SetFont( oFont )
   
   DEFINE MESSAGE oMessage OF oWnd 2015  //TO ""
   DEFINE MSGITEM oAnsi PROMPT "Ansi: " + if( !Empty( oRTF ), if( oRTF:lUtf8, " NO", " SI" ), " SI" ) ;
      OF oMessage SIZE 100
   DEFINE MSGITEM oUtf8 PROMPT "Utf8: " + if( !Empty( oRTF ), if( oRTF:lUtf8, " SI", " NO" ), " NO" ) ;
      OF oMessage SIZE 100
   DEFINE MSGITEM oUtf16 PROMPT "Utf16: " + if( !Empty( oRTF ), if( oRTF:lUtf16, " SI", " NO" ), " NO" ) ;
      OF oMessage SIZE 100
   DEFINE MSGITEM oBom PROMPT "Bom: " + if( !Empty( oRTF ), if( oRTF:lBom, " SI", " NO" ), " NO" ) ;
      OF oMessage SIZE 100
   DEFINE MSGITEM oBig PROMPT "Big Endian: " + if( !Empty( oRTF ), if( oRTF:lBig, " SI", " NO" ), " NO" ) ;
      OF oMessage SIZE 100
   DEFINE MSGITEM oUnicode PROMPT "Unicode: " + if( !Empty( oRTF ), if( oRTF:lUtf8, "   ", "   " ), " NO" ) ;
      OF oMessage SIZE 100

   DEFINE BUTTONBAR oWnd:oBar SIZE 70, 32 2015

   DEFINE BUTTON OF oWnd:oBar PROMPT "Exit"   CENTER ACTION ( oWnd:End() )   
   DEFINE BUTTON OF oWnd:oBar PROMPT "Rtf"    CENTER ACTION ( nFilter := 1, ;
          oBrw:aArrayData := ReadFolder(), oBrw:Refresh( .t. ), VerDoc( oBrw ) )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Text"   CENTER ACTION ( nFilter := 11, ;
          oBrw:aArrayData := ReadFolder(), oBrw:Refresh( .t. ), VerDoc( oBrw ) )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Images" CENTER ACTION ( nFilter := 2 , ;
          oBrw:aArrayData := ReadFolder(), oBrw:Refresh( .t. ), VerDoc( oBrw ) )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Object" CENTER ACTION ( nFilter := 3 , ;
          oBrw:aArrayData := ReadFolder(), oBrw:Refresh( .t. ), VerDoc( oBrw ) )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Dbf"    CENTER ACTION ( nFilter := 4 , ;
          oBrw:aArrayData := ReadFolder(), oBrw:Refresh( .t. ), VerDoc( oBrw ) )
   DEFINE BUTTON OF oWnd:oBar PROMPT "All"    CENTER ACTION ( nFilter := 0 , ;
          oBrw:aArrayData := ReadFolder(), oBrw:Refresh( .t. ), VerDoc( oBrw ) )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Folder" CENTER ;
      ACTION ( cDirName := cGetDir( "Select Folder", GetCurDir() + "\" ), ;
               SetCurDir( cDirName ), ;
               oBrw:aArrayData := ReadFolder(), oBrw:Refresh( .t. ), VerDoc( oBrw ) )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Print"    CENTER ACTION ( ;
           PrintRtf( .T., oRTF, ,  ) )  //PrintRtf( lPreview, oRTF, oPrn, aRTF )

   @ oWnd:nHeight, 0 XBROWSE oBrw SIZE nWBrw, -oWnd:nHeight ;
      PIXEL OF oWnd DATASOURCE aImages COLUMNS 1 CELL LINES NOBORDER AUTOSORT

   WITH OBJECT oBrw
      :l2007 := .F.
      :aCols[ 1 ]:cHeader := "Files"
      :nStretchCol   := 1
      :bChange       := { | o | VerDoc( o ) }
      :bLDblClick    := { | o | LookOthers( oBrw ) }
      :bClrStd       := { || { If( oBrw:aRow[ 3 ] == 1, CLR_BLUE, CLR_HRED ), CLR_WHITE } }
      :bKeyDown      := { |n,f| if( n = VK_RETURN, Eval( oBrw:bLDblClick ), ) }
      :CreateFromCode()
   END

   WITH OBJECT oWnd
      :nWidth     := ScreenWidth()  * 0.6
      :nHeight    := ScreenHeight() * 0.6
   END

   @ oWnd:nHeight, nWBrw RICHEDIT5 oRTF VAR cRTF OF oWnd ;
        SIZE oWnd:nWidth - ( nWBrw + 18 ), oBrw:nHeight*1.82 PIXEL NOBORDER HSCROLL

   ACTIVATE WINDOW oWnd CENTERED ON INIT VerDoc( oBrw ) ;
      ON PAINT ( oRTF:SetSize( oWnd:nWidth - ( nWBrw + 18 ), oBrw:nHeight-2 ) ) //ON INIT oWnd:SetControl( oRTF )
   
   RELEASE FONT oFont
   //RELEASE BRUSH oBrush

return nil

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

Function VerDoc( oBrw )

   local nOpc      := 0
   local lText     := .F.
   //local cFile     := AnsiToWide( AllTrim( oBrw:aRow[ 2 ] ) )
   local cFile     := if( Len( oBrw:aArrayData ) > 0, AllTrim( oBrw:aRow[ 2 ] ), "" )
   local aFiles    := {}
   local cText     := ""
   local oError
   
   if !Empty( cFile )
      if !Empty( Ascan( aFilesTxt, Upper( cFileExt( oBrw:aRow[ 2 ] ) ) ) )
         nOpc  := 1
      endif
      if Empty( nOpc )
         if !Empty( Ascan( aFilesImg, Upper( cFileExt( oBrw:aRow[ 2 ] ) ) ) )
            nOpc  := 2
         endif
      endif
      if Empty( nOpc )
         if !Empty( Ascan( aFilesObj, Upper( cFileExt( oBrw:aRow[ 2 ] ) ) ) )
            nOpc  := 3
         endif
      endif
      if Empty( nOpc )
         if !Empty( Ascan( aFilesAll, Upper( cFileExt( oBrw:aRow[ 2 ] ) ) ) )
            nOpc  := 4
         endif
      endif
   endif
   oRTF:SetClear()
   oRTF:SelectAll()
   oRTF:Del()
   //TRY
   Do Case
      Case nOpc = 0
         lText  := .T.
         oRTF:SetText( "<File Format not supported>" )
      
      Case nOpc = 1

         if Upper( cFileExt( cFile ) ) <> "RTF"
            if Upper( cFileExt( cFile ) ) == "ZIP"         
               aFiles := hb_GetFilesInZip( cFile )
               if !Empty( aFiles )
                  cText  += Upper( cFileNoPath( cFile ) ) + "=> " + CRLF
                  AEVal( aFiles, { | a | cText += Chr( 9 ) + Chr( 9 ) + Chr( 9 ) + a + CRLF } )
                  lText  := .T.
                  oRTF:SetText( cText )
               endif
            else
               lText  := .T.
               cText  := MemoRead( cFile )
               oRTF:DocIsUtf8( cText, )
               //? oRTF:lUtf8, oRTF:lUtf16, oRTF:lBom, oRTF:lBig
               if IsUtf8( cText )
                  oRTF:SetText( cText )
                  //oRTF:SetText( AnsiToWide( Right( cText, Len( cText ) - 3 ) ) )
                  //oRTF:SetText( Utf16toUtf8( cText ) )
               else
                  oRTF:SetText( cText )
               endif
            endif
         else
            oRTF:LoadFromRTFFile( cFile )
         endif
      
      Case nOpc = 2
         if FITypeFromMemory( MemoRead( cFile ) ) >= 0
            oRTF:InsertPictureFile( cFile )
         else
            oRTF:SetText( "<File Format Image not valid>" )         
         endif
      Case nOpc = 3
         
         oRTF:InsertObject( cFile ) //+ Chr( 0 ) )

      Case nOpc = 4
         lText  := .T.
         oRTF:ViewDbf( cFile )

      Otherwise
      
         oRTF:LoadRTF( cFile )      

   EndCase
   /*
   CATCH oError
         MsgInfo( "File Explorer " + ";"  + ;
                  "Error: "  + TRANSFORM(oError:GenCode, NIL) + ";" + ;
                  "SubC: "   + TRANSFORM(oError:SubCode, NIL) + ";" + ;
                  "OSCode: " + TRANSFORM(oError:OsCode, NIL) + ";" + ;
                  "SubSystem: " + TRANSFORM(oError:SubSystem, NIL) + ";" + ;
                  "Message: " + oError:Description + " "+ cFile )
   END
   */
   oAnsi:SetText( "Ansi: " + if( oRTF:lUtf8, " NO", " SI" ) )
   oUtf8:SetText( "Utf8: " + if( oRTF:lUtf8, " SI", " NO" ) )
   oUtf16:SetText( "Utf16: " + if( oRTF:lUtf16, " SI", " NO" ) )
   oBom:SetText( "Bom: " + if( oRTF:lBom, " SI", " NO" ) )
   oBig:SetText( "Big Endian: " + if( oRTF:lBig, " SI", " NO" ) )
   oUnicode:SetText( "Unicode: " + if( oRTF:lUtf8, "   ", "   " ) )
   oAnsi:Refresh()
   oUtf8:Refresh()
   oUtf16:Refresh()
   oBig:Refresh()
   oUnicode:Refresh()
   oBom:Refresh()

Return nil

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

Static Function LookOthers( oBrw )

   local nOpc      := 0
   
   if !Empty( Ascan( aFilesTxt, Upper( cFileExt( oBrw:aRow[ 2 ] ) ) ) )
      nOpc  := 1
   endif
   if Empty( nOpc )
      if !Empty( Ascan( aFilesImg, Upper( cFileExt( oBrw:aRow[ 2 ] ) ) ) )
         nOpc  := 2
      endif
   endif
   if Empty( nOpc )
      if !Empty( Ascan( aFilesObj, Upper( cFileExt( oBrw:aRow[ 2 ] ) ) ) )
         nOpc  := 3
      endif
   endif
   if Empty( nOpc )
      if Upper( cFileExt( oBrw:aRow[ 2 ] ) ) = "DBF"
         XBrowse( oBrw:aRow[ 2 ] )
      else
         MsgInfo( "Format not supported", oBrw:aRow[ 2 ] )
      endif
   endif

Return nil

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

static function ReadFolder()

   local aImages  := {}
   local aSub     := { "*" }
   local c
   local x
   local cPath    := cDirName
   local aDir
   local aAlls    := {}

   AEVal( aFilesTxt, { | a | AAdd( aAlls, a ) } )
   AEVal( aFilesImg, { | a | AAdd( aAlls, a ) } )
   AEVal( aFilesObj, { | a | AAdd( aAlls, a ) } )
   AEVal( aFilesAll, { | a | AAdd( aAlls, a ) } )

   Do Case
      Case nFilter = 0
           aSub    := { "*" }
      Case nFilter = 1
           aSub    := { "rtf" } 
      Case nFilter = 11
           aSub    := aClone( aFilesTxt )
           aSub    := ADel( aSub, 1 )
           ASize( aSub, Len( aSub ) - 1 )
      Case nFilter = 2
           aSub    := aClone( aFilesImg )
      Case nFilter = 3
           aSub    := aClone( aFilesObj )
      Case nFilter = 4
           aSub    := { "dbf" } 
   EndCase
   
   for each c in aSub
      aDir     := Directory( cPath + "\*." + c )
      AEval( aDir, { | a | AAdd( aImages, { Lower( a[ 1 ] ), ;
                           Lower( TrueName( cPath + "\" + a[ 1 ] ) ), 0 } ) } )
   next
   For x = 1 to Len( aImages )
      if !Empty( Ascan( aAlls, Upper( cFileExt( aImages[ x ][ 2 ] ) ) ) )
         aImages[ x ][ 3 ] := 1
      endif
   Next x
   
   ASort( aImages,,,{ | x, y | Lower( x[ 1 ] ) < Lower( y[ 1 ] ) } )

return aImages

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

Function PrintRtf( lPreview, oRTF, oPrn, aRTF )

   local lPrn
   DEFAULT aRTF := { 100, 1000, 510, 1490, 1990 }  // { nFrom, nTop, nLeft, nBottom }
   DEFAULT lPreview := .f.

   if Empty( oPrn )
      lPrn    := .F.
      if lPreview
         PRINT oPrn NAME "FWH RICHEDIT FILE" PREVIEW
      else
         PRINT oPrn NAME "FWH RICHEDIT FILE"
      endif

      if Empty( oPrn:hDC )
         MsgStop( "Printer not ready!" )
         return nil
      endif
    else
       lPrn    := .T.
    endif
    if !lPrn  
      PAGE
         CursorWait()
         
         oPrn:Box( aRTF[ 2 ], 500, aRTF[ 2 ] + 1000, 1500 )

         aRTF := REPrintBox5( oRTF:hWnd, If( lPreview, oPrn:hDCOut, oPrn:hDC ), ;
                             oRTF:IsSelection(), ;
                             aRTF[ 2 ] + 10, 510, 1490, aRTF[ 2 ] + 990, aRTF[ 1 ] )

         CursorArrow()
      ENDPAGE

      ENDPRINT
   else
         oPrn:Box( aRTF[ 2 ], aRTF[ 3 ], aRTF[ 4 ], aRTF[ 5 ] )

         aRTF := REPrintBox5( oRTF:hWnd, If( lPreview, oPrn:hDCOut, oPrn:hDC ), ;
                             oRTF:IsSelection(), ;
                             aRTF[ 2 ], aRTF[ 3 ], aRTF[ 4 ], aRTF[ 5 ], aRTF[ 1 ] )
   
   endif
return aRTF

//----------------------------------------------------------------------------//
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: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Tue Mar 07, 2017 02:04 PM

Hola Cristobal:
Tengo la necesidad de mostrar un documento Word pero sin que tenga la posibilidad de editarlo.
Intento utilizar el ejemplo tuyo insertando el documento en el Richedit como vos lo hiciste y me muestra, aleatoriamente, un mensaje que dice que FILE NOT FOUND y C.
No lo hace siempre.
Ademas, solo me muestra (tanto en tu programa como en el mio) solo la primera hoja del documento word.
Alguna pista?
Gracias por tu tiempo y tus ejemplos!

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Tue Mar 07, 2017 05:44 PM

El objetivo de los ejemplos es ver como insertar objetos de otros programas en un .RTF, pero no es un editor por s铆 mismo
Quiero decir, que si tu insertas un objeto de un documento pdf en un RTF y pulsas doble click te envia al visualizador de PDFs que tengas configurado por defecto, lo mismo hace con los documentos WORD. Es un "visor", por eso solo te muestra la primera p谩gina del documento.
Pero, igual funciona WORD. Si tu insertas un objeto PDF s贸lo te muestra la primera p谩gina y al dar doble click te abre el Adobe o el visualizador que tengas configurado.

En cuanto al problema que comentas, me he dado cuenta. Voy a darle unas vueltas a ver si veo donde puede estar el problema

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: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Thu Mar 09, 2017 10:27 AM

Cristobal!!
Entendido perfectamente!! Gracias por responder!!
Si encuentras el porque del mensaje aleatorio te lo agradezco que lo compartas.
Un saludo grande!

Posts: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Fri May 19, 2017 02:54 PM

Cristobal buenos d铆as

Primero que todo quiero darte gracias por toda la ayuda que brindas a la comunidad fw.

Por otro lado tengo la necesidad de mostrar un documento pdf completo, dentro de mi aplicaci贸n. Me podr铆as pegar una ayudita.

Saludos

Saludos
LEANDRO AREVALO
Bogot谩 (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Fri May 19, 2017 04:15 PM
Este codigo me funciona en Win 10
Code (fw): Select all Collapse
#include "Fivewin.ch"

Function Main()

聽 聽local oWndPdf
聽 聽local oPdf

聽 聽DEFINE WINDOW oWndPdf TITLE "Visualizar/Imprimir PDF - Adobe Reader"
聽 聽 
聽 聽 // oPdf 聽:= ShowPdf1( oWndPdf ) 聽 聽// Tambien funciona
聽 聽ACTIVATE WINDOW oWndPdf MAXIMIZED ;
聽 聽 聽 ON INIT ( oPdf := ShowPDF1( oWndPdf ) ) ;
聽 聽 聽 VALID ( oPdf:End(), .T. )

Return nil

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

FUNCTION ShowPDF1( oWnd ) 

聽 聽local oPdf

聽 聽oPdf := TActiveX():New( oWnd, "AcroPDF.PDF.1" )
聽 聽oPdf:nTop 聽 聽:= 5
聽 聽oPdf:nLeft 聽 := 5
聽 聽oPdf:nWidth 聽:= 500 聽 //
聽 聽oPdf:nHeight := 700 聽 //驴?
聽 聽//oWnd:oClient := oPdf
聽 聽//oWnd:oTop := oPdf
聽 聽oWnd:oLeft := oPdf
聽 聽//oWnd:oRight := oPdf
聽 聽//oWnd:oBottom := oPdf

聽 聽//oPdf:SetViewRect( 0, 0, 500, 600 )
聽 聽//oPdf:Do( "SetShowToolbar", .T. )
聽 聽oPdf:Do( "LoadFile", ".\SCINTILLA DOCUMENTATION.pdf" )
聽 聽oPdf:Do( "SetCurrentPage", 1 )
聽 聽oPdf:SetZoom( 80 )

RETURN oPdf

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


M谩s informacion sobre los metodos

viewtopic.php?f=6&t=26276&p=144617&hilit=AcroPDF.PDF.1#p144617
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: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Fri May 19, 2017 05:35 PM

De nuevo gracias

Voy a hacer pruebas y comento.

Saludos
LEANDRO AREVALO
Bogot谩 (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 344
Joined: Sat Jul 22, 2006 09:04 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Fri Mar 09, 2018 02:33 PM

Hola Cristobal vi el visor de PDF que compartiste mas arriba con activeX, se puede hacer algo similar con un archivo de word?
Saludos

FWH - Harbour - BCC7 - PellesC
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Fri Mar 09, 2018 03:24 PM

Hola Marcelo
Vamos por partes:
- Lo que utilizo para ver los ficheros .doc, o .xls es incrustar un objeto en un fichero .rtf, pero s贸lo, evidentemente te permite ver la primera p谩gina del documento
- Si lo que quieres es poder visualizar todo el documento .doc, lo que tienes que hacer es mediante un activex, convertir el .doc a .rtf ( duplicarlo ) y ya podr铆as ver todo el documento con un control RichEdt ( que es el que se utiliza para los documentos .rtf a la derecha del browse )

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: 344
Joined: Sat Jul 22, 2006 09:04 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Fri Mar 09, 2018 03:31 PM

Ante que nada gracias por tomarte el tiempo de responderme Cristobal, te cuento, tengo unos archivos en word .doc que utilizo de plantilla, la idea es utilizar richedit y me gustaria incrustar la edicion de esa plantilla dentro de una MDI, poder editarla y guardar el archivo .rtf

FWH - Harbour - BCC7 - PellesC
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Fri Mar 09, 2018 03:48 PM
Eso no es complicado
Creas un objeto, para abrir el fichero .doc
Code (fw): Select all Collapse
oWord 聽 聽 聽:= CreateObject( "Word.Application" )

y buscas informaci贸n sobre su m茅todo SaveAs, y los tipos de ficheros a los que puedes exportar
https://msdn.microsoft.com/es-es/librar ... 39952.aspx
Lo dem谩s es incrustar el objeto TRichEdt5 en una mdi
Tienes un ejemplo en samples, aunque no s茅 si en tu versi贸n de Fw lo tendr谩s
Cuando puedas actual铆zate a una versi贸n m谩s reciente: lo agradecer谩s
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: 344
Joined: Sat Jul 22, 2006 09:04 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Fri Mar 09, 2018 04:10 PM

Buen铆simo much铆simas gracias Cristobal por la ayuda y la informaci贸n.
Saludos desde aqu铆.

FWH - Harbour - BCC7 - PellesC
Posts: 632
Joined: Thu Jan 19, 2006 10:45 AM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Sat Mar 24, 2018 08:49 PM
Hola Cristobal, una colsulta del acroPDF.1, cuando ejecuto la aplicaci贸n desde c贸digo no puedo resaltar el texto para nada si la ejecuto desde el acrobat DC pro que tengo legal me funciona el mismo fichero sin problemas pero desde c贸digo no hay manera, puedo llegar a ver las herramientas de resaltado el t铆pico foxfi pero esta en formato draf o sea difuminado, sabes si se puede desde codigo activar para poder ver la herramienta.

Code (fw): Select all Collapse
DEFINE WINDOW oWnd TITLE x_title
聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 oActiveX = TActiveX():New( oWnd, "AcroPDF.PDF.1" )

聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 oWnd:oClient = oActiveX // To fill the entire window surface
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 //oActiveX:Do( "SetShowToolbar", .T. ) //esto no me muestra nada diferente

聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 oActiveX:Do( "LoadFile", x_file )
聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 oActiveX:Do( "SetCurrentPage", 1 )

聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 ACTIVATE WINDOW oWnd MAXIMIZED
Saludos



Andr茅s Gonz谩lez desde Mallorca
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ver PDF dentro de la aplicaci贸n
Posted: Sat Mar 24, 2018 09:06 PM

Hola Andr茅s
Lo primero que tienes que comprobar es si el activex para esa version se ha de crear con la misma clase
Inspecciona los objetos activex disponibles a ver si hay alg煤n otro
Esta herramienta te puede servir

viewtopic.php?f=6t=26276start=60#p144732

&&

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