Página 1 de 1

Exemplo Embed e Export PDF para Sumatra

Publicado: 03 Ene 2018 20:48
por dripro
HIDE: ON
Hidebb Message Hidden Description


Image_1
Imagen

Image_2
Imagen



--------------------------->> Incorporar 
--------------------------->> On Preload     ou    Globals Functions
xMount = {}
function xMount.Window(Filename,Size,Width,Height,X,Y,Delay)
local xWindow = {}
--Application.Sleep(Delay);
xWindow.PWnd = Application.GetWndHandle();
local xPwndSize = Window.GetSize(xWindow.PWnd);
xWindow.Width = xPwndSize.Width - 15
xWindow.Height = xPwndSize.Height - 30
xWindow.X = 0
xWindow.Y = 0
xWindow.Size = Size
  
blnEmbedded=false;
while (blnEmbedded==false) do
xProcesses = Window.EnumerateTitles();
Filename = "Relatório.pdf"
 for handle,path in pairs(xProcesses) do
xWindow.Find = String.Find(path, Filename, 1, false);
 if xWindow.Find ~= -1 then
 xWindow.CWnd = handle
 blnEmbedded=true;

repeat

Window.SetOrder(handle,  HWND_TOPMOST);
xWindow.IsPWnd = DLL.CallFunction(_SystemFolder .. "\\User32.dll", "SetParent",  xWindow.CWnd..","..xWindow.PWnd, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);  

until xWindow.IsPWnd ~= ""
if xWindow.Size == "CUSTOM" then
Window.SetSize(xWindow.CWnd, Width, Height);
Window.SetPos(xWindow.CWnd, X, Y); 
Window.Show(xWindow.CWnd);
Page.Redraw();
elseif xWindow.Size == "DEFAULT" then
Window.Maximize(xWindow.CWnd);
Window.Show(xWindow.CWnd);
Page.Redraw();
end
return xWindow
end
end
--return nil;
end
end

function xMount.Resize(ParentWndHandle,ChildWndHandle,Size,Width,Height,X,Y)
  if Size == "DEFAULT" then
    local xPwndSize = Window.GetSize(ParentWndHandle);
    local Width = xPwndSize.Width - 17
    local Height = xPwndSize.Height - 40
    Window.SetSize(ChildWndHandle, Width, Height);
    Window.SetPos(ChildWndHandle, 0, 0);
    Window.Maximize(ChildWndHandle);
    Window.Show(ChildWndHandle);
    Page.Redraw();
  elseif Size == "CUSTOM" then
    Window.SetSize(ChildWndHandle, Width, Height);
    Window.SetPos(ChildWndHandle, X, Y);
    Window.Show(ChildWndHandle);
    Page.Redraw();
  elseif Size == "" or Size == nil then
    return nil
  end
end

function xMount.Close(ChildWndHandle)
Window.Close(ChildWndHandle, CLOSEWND_SENDMESSAGE);
Page.Redraw();
end



------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------->> On Size
if tblMount ~= nil then
  xMount.Resize(tblMount.PWnd,tblMount.CWnd,"DEFAULT",nil,nil,nil,nil);
end


------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------->> xButton      On Click
Window.Maximize(Application.GetWndHandle());
sPDFRootFolder = "Relatório\\Relatório.pdf";
sPage = File.Run("SumatraPDF.dll", sPDFRootFolder, "", SW_SHOWNORMAL, false); 
tblMount = xMount.Window(sPage,"DEFAULT",nil,nil,nil,nil,1900); 

Re: Exemplo Embed e Export PDF para Sumatra

Publicado: 10 Mar 2018 18:00
por oussemaTN
thnkssssssssssssssss

Re: Exemplo Embed e Export PDF para Sumatra

Publicado: 13 Mar 2018 03:15
por luasqlite
Thank You amigo

Re: Exemplo Embed e Export PDF para Sumatra

Publicado: 02 Jul 2018 05:55
por Chilepunk20182018
:yes: :yes:

Re: Exemplo Embed e Export PDF para Sumatra

Publicado: 15 May 2019 07:27
por gruposasp
a testear

Re: Exemplo Embed e Export PDF para Sumatra

Publicado: 01 Jun 2019 00:11
por RuriNyan
gracias

Re: Exemplo Embed e Export PDF para Sumatra

Publicado: 10 Jul 2019 18:51
por electrobyte
Gracias

Re: Exemplo Embed e Export PDF para Sumatra

Publicado: 01 Jul 2022 01:30
por marcpv89
thanks

Re: Exemplo Embed e Export PDF para Sumatra

Publicado: 08 Jul 2023 10:57
por dangngocnguyenit
:penguin: :penguin: :penguin:

Re: Exemplo Embed e Export PDF para Sumatra

Publicado: 05 Sep 2023 02:21
por Smain
gracias