Jump to content
Fivewin Brasil

ACTIVE X COM ADOBE READER


kapiaba

Recommended Posts

Personas, testando em \samples\PDF2.PRG, funciona legal, porém não me abre o MENU do ADOBE READER, somente se eu teclo ESCAPE, ele mostra o MENU do ADOBE READER, qual comando para já abrir o MENU do ABOBE READER direto, sem precisar teclar SCAPE usando ACTIVE X?




PDF2.png


// C:\FWH1306\SAMPLES\PDF2.PRG



// FiveWin ActiveX support demo - Using Adobe Acrobat Reader

#include "FiveWin.ch"

function Main()

local oWnd, oBtn

DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

@ 2, 2 BUTTON oBtn PROMPT "Show PDF" SIZE 80, 20 ;
ACTION ShowPDF( oWnd, oBtn )

ACTIVATE WINDOW oWnd MAXIMIZED

return nil

function ShowPDF( oWnd, oBtn )

local oActiveX

oActiveX = TActiveX():New( oWnd, "AcroPDF.PDF.1" ) // Use "AcroPDF.PDF.1" for Acrobat Reader 7

oWnd:oClient = oActiveX // To fill the entire window surface

oActiveX:Do( "LoadFile", "fwintro.pdf" )
oActiveX:Do( "SetCurrentPage", 1 )

oBtn:Hide()
oWnd:ReSize()

return nil


Obg. Abs.

Link to comment
Share on other sites

Resolvido / Resuelto / Solved.. kkkkkkkkkkkkkkkkkk



#include "FiveWin.ch"

function Main()

local oWnd, oActiveX, oPdf, cTmp

DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

oPdf := TActiveX():New( oWnd, "AcroPDF.PDF.1" )

oWnd:oClient := oPdf

oPdf : src = CurDrive() + ":\" + CurDir() + "\fwintro.pdf"

oPdf:Do( "SetPageMode", "thumbnail and pages" )

oPdf:SetProp( "Src", cTmp )

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

oPdf:Do( "GetVersions" )

oPdf:Do( "SetCurrentPage", 1 )

oPdf:Do( "SetShowToolbar", .T. ) // Mostra o Menu do Adobe Reader

ACTIVATE WINDOW oWnd

return nil


Link to comment
Share on other sites

Personas, isto funciona perfeito, mas me surgiu uma dúvida:


O preview do Adobe Reader, com este exemplo, somente mostra os botões do Adobe, Como faço, para para mostrar o MENU PRINCIPAL do ADOBE READER, para que o Usuário possa ver a Opção <Sair> do menu? Ou o Botão <Sair>?



FUNCTION ShowPDF_READER( cAlias ) // usando o ADOBE READER - 25/11/2013

LOCAL oWndPdf, oPdf, cTmp

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

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

oWndPdf:oClient := oPdf

oPdf : src = CurDrive() + ":\" + CurDir() + "\fwintro.pdf"

// Mostra Preview Pequeno no lado esquedo 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..

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

ACTIVATE WINDOW oWndPdf MAXIMIZED

RETURN NIL


Obg. abs.

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...