ola pessoal,
tenho um documento salvo em pdf ja pronto e preciso imprimir algumas copias utilizando meu sistema em harbour.
procurei no forum mas vi a opcao de gerar e imprimir, e neste caso ja tenho ele pronto, é so imprimir direto pelo sistema.
tentei Myrun("arquivo.pdf") mas neste caso ele abre o arquivo e o usuario teria que utilizar a opcao de imprimir, e gostaria de imprimir direto.
alguem sabe se existe alguma forma de fazer isso ?
Utilizo harbour, modo console
Desde ja agradeço,
Abel
imprimir um documento em pdf ja pronto
Moderador: Moderadores
imprimir um documento em pdf ja pronto
Para fazer isso, utilizo um outro programa, o SumatraPDF
Basta colocar o EXE dele juntamente ao seu executavel e utilizar a linha de comando correta!
Utilizo ele em varios programas que eu desenvolvi em Harbour, p/ imprimir o PDF....
https://code.google.com/p/sumatrapdf/wi ... eArguments
Basta colocar o EXE dele juntamente ao seu executavel e utilizar a linha de comando correta!
Utilizo ele em varios programas que eu desenvolvi em Harbour, p/ imprimir o PDF....
https://code.google.com/p/sumatrapdf/wi ... eArguments
imprimir um documento em pdf ja pronto
Exemplo usando sumatra.
Você baixa o sumatra neste endereço:
http://blog.kowalczyk.info/software/sum ... er-pt.html
Você baixa o sumatra neste endereço:
http://blog.kowalczyk.info/software/sum ... er-pt.html
Código: Selecionar todos
FUNCTION MAIN
PRIVATE cPrinter:=WIN_PrinterGetDefault()
IMP_PDF("SEUPDF.PDF",.T.)
RETURN Nil
FUNCTION Imp_PDF( cSource,lEspera )
LOCAL oShell, lOk:=.T., nStyle
HB_Default(@lEspera,.T.)
TRY
oShell:=win_OleCreateObject( "WScript.Shell" )
CATCH
TRY
oShell:=win_OleCreateObject( "WScript.Shell" )
CATCH
lOk:=.F.
END
END
IF lOk
TRY
/*
intWindowStyle
Description
0 Hides the window and activates another window.
1 Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
2 Activates the window and displays it as a minimized window.
3 Activates the window and displays it as a maximized window.
4 Displays a window in its most recent size and position. The active window remains active.
5 Activates the window and displays it in its current size and position.
6 Minimizes the specified window and activates the next top-level window in the Z order.
7 Displays the window as a minimized window. The active window remains active.
8 Displays the window in its current state. The active window remains active.
9 Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
10 Sets the show-state based on the state of the program that started the application.
*/
nStyle:=0
oShell:Run("sumatrapdf.exe -print-to "+'"'+cPrinter+'"'+" -reuse-instance -lang pt "+'"'+cSource+'"', nStyle, lEspera)
CATCH
lOk:=.F.
END
oShell:=Nil
ENDIF
RETURN lOk
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
imprimir um documento em pdf ja pronto
o sumatraPDF é a opção
ou se tiver dinheiro pode usar o sdk da propria adobe
http://www.adobe.com/devnet/pdf/library.html
ou se tiver dinheiro pode usar o sdk da propria adobe
http://www.adobe.com/devnet/pdf/library.html
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
imprimir um documento em pdf ja pronto
Se não me engano, só abrir passando o parâmetro /p
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/




