Bom dia...
No anexo que baixei aqui não tem prg não...
Os teste que fiz no executável aqui... só imprime um independente da ordem... quando vai imprimir o outro dá pau...
att..
Rubens

Moderador: Moderadores
FUNCTION TestDanfe()
LOCAL oDanfe, oFile, oFileList, cFilePdf
oFileList := Directory( "*.xml" )
FOR EACH oFile IN oFileList
oDanfe := hbNfeDaGeral():New()
cFilePdf := Substr( oFile[ F_NAME ], 1, At( ".", oFile[ F_NAME ] ) ) + "pdf"
fErase( cFilePdf )
//oDanfe:cLogoFile := JPEGImage()
oDanfe:cDesenvolvedor := "www.josequintas.com.br"
oDanfe:ToPDF( oFile[ F_NAME ], cFilePdf )
? oFile[ F_NAME ], oDanfe:cRetorno
PDFOpen( cFilePdf )
NEXT
RETURN NIL
FUNCTION PDFOpen( cFile )
IF File( cFile )
WAPI_ShellExecute( NIL, "open", cFile, "",, WIN_SW_SHOWNORMAL )
Inkey(1)
ENDIF
RETURN NIL
#include 'FIVEWIN.CH'
#define DLL_CDECL 0x08
#define DLL_STDCALL 0x20
#define DLL_SYSTEM 0x04
#define STR_LEN 256
function Main()
local oWnd
define window oWnd from 5,5 to 30,85 title "ACBrLib Teste"
@ 3,10 BUTTON "Imprime NF-e" size 100,50 OF oWnd ACTION ImprimirNFE()
@ 3,40 BUTTON "Imprime SAT" size 100,50 OF oWnd ACTION ImprimirSAT()
set message of oWnd to "Teste ACBrLib" date time noinset
activate window oWnd centered
return nil
static function ImprimirNFE(eArquivoOuXml, cImpressora, nNumCopias, cProtocolo, bMostrarPreview, cMarcaDagua, bViaConsumidor, bSimplificado)
local hResult, bufferLen, buffer, oErr
local oDll := DllLoad( 'ACBrNFe32.dll' )
eArquivoOuXml := if(eArquivoOuXml=nil, "acbrnfe.xml", eArquivoOuXml)
cImpressora := if(cImpressora=nil, "", cImpressora)
nNumCopias := if(nNumCopias=nil, 1, nNumCopias)
cProtocolo := if(cProtocolo=nil, "", cProtocolo)
bMostrarPreview := if(bMostrarPreview=nil, "True", bMostrarPreview)
cMarcaDagua := if(cMarcaDagua=nil, "", cMarcaDagua)
bViaConsumidor := if(bViaConsumidor=nil, "", bViaConsumidor)
bSimplificado := if(bSimplificado=nil, "", bSimplificado)
hResult := DllCall(oDll, DLL_CDECL, "NFE_Inicializar", hb_StrToUTF8("ACBrLib.Ini"), hb_StrToUTF8(""))
hResult := DllCall(oDll, DLL_CDECL, "NFE_CarregarXML", hb_StrToUTF8(eArquivoOuXml))
hResult := DllCall(oDll, DLL_CDECL, "NFE_Imprimir", hb_StrToUTF8(cImpressora), nNumCopias, hb_StrToUTF8(cProtocolo), hb_StrToUTF8(bMostrarPreview), hb_StrToUTF8(cMarcaDagua), hb_StrToUTF8(bViaConsumidor), hb_StrToUTF8(bSimplificado))
if !Empty(hResult)
bufferLen := STR_LEN
buffer := Space(bufferLen)
oErr := DllCall(oDll, DLL_CDECL, "NFE_UltimoRetorno", @buffer, @bufferLen)
MsgStop(buffer, "Erro: "+Str(hResult))
endif
DllCall(oDll, DLL_CDECL, "NFE_Finalizar")
DllUnload(oDll)
return nil
static function ImprimirSAT(eArquivoOuXml, cImpressora)
local hResult, bufferLen, buffer, oErr
local oDll := DllLoad( 'ACBrSat32.dll' )
eArquivoOuXml := if(eArquivoOuXml=nil, "acbrsat.xml", eArquivoOuXml)
cImpressora := if(cImpressora=nil, "", cImpressora)
hResult := DllCall(oDll, DLL_CDECL, "SAT_Inicializar", hb_StrToUTF8("ACBrLib.Ini"), hb_StrToUTF8(""))
hResult := DllCall(oDll, DLL_CDECL, "SAT_ImprimirExtratoVenda", hb_StrToUTF8(eArquivoOuXml), hb_StrToUTF8(cImpressora))
if !Empty(hResult)
bufferLen := STR_LEN
buffer := Space(bufferLen)
oErr := DllCall(oDll, DLL_CDECL, "SAT_UltimoRetorno", @buffer, @bufferLen)
MsgStop(buffer, "Erro: "+Str(hResult))
endif
DllCall(oDll, DLL_CDECL, "SAT_Finalizar")
DllUnload(oDll)
return nil
Não querendo cuspir no prato que comi... mas fica muito dependente de você...
Qualquer alteração que precisa a gente precisa mudar os fontes... e daà não consegue acompanhar as suas atualizações..
Daà o interesse pelo ACBRLIB ou ACBRDLL.. Já estou usando para impressão e colocarei para emitir nfce. Então quanto mais gente aderir e pudermos ajudar uns aos outros menos bugs aparecerão nos clientes..
e daà não consegue acompanhar as suas atualizações..
quero ver se ainda este ano consigo dar inicio nos testes com Sefazclass+SSL,
resolveu o problema dele.oribeiro escreveu:Grande Quintas,
Foi só não descarregar a DLL que resolveu o meu problema.
A sua sugestão foi certeira!
MuitÃssimo obrigado.
#include 'FIVEWIN.CH'
#define DLL_CDECL 0x08
#define DLL_STDCALL 0x20
#define DLL_SYSTEM 0x04
#define STR_LEN 256
function Main()
local oWnd
public oACBrNFe32 := DllLoad( 'ACBrNFe32.dll' )
public oACBrSat32 := DllLoad( 'ACBrSat32.dll' )
define window oWnd from 5,5 to 30,85 title "ACBrLib Teste"
@ 3,10 BUTTON "Imprime NF-e" size 100,50 OF oWnd ACTION ImprimirNFE()
@ 3,40 BUTTON "Imprime SAT" size 100,50 OF oWnd ACTION ImprimirSAT()
set message of oWnd to "Teste ACBrLib" date time noinset
activate window oWnd centered
return nil
static function ImprimirNFE(eArquivoOuXml, cImpressora, nNumCopias, cProtocolo, bMostrarPreview, cMarcaDagua, bViaConsumidor, bSimplificado)
local hResult, bufferLen, buffer, oErr
local oDll := oACBrNFe32 // DllLoad( 'ACBrNFe32.dll' )
...
static function ImprimirSAT(eArquivoOuXml, cImpressora)
local hResult, bufferLen, buffer, oErr
local oDll := oACBrSat32 // DllLoad( 'ACBrSat32.dll' )
...
Retornar para Legislação Fiscal e Tributária
Usuários vendo este fórum: Bing [Bot] e 7 visitantes