PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → PDFlib et Windev
PDFlib et Windev
Iniciado por Benoît, 30,nov. 2004 17:50 - 1 respuesta
Publicado el 30,noviembre 2004 - 17:50
Bonjour,

Je viens d'acquérir la PDFLib. Je viens de regarder les exmples livré pour fonctionner avec Delphi, VBS, VB, VBA,ASP mais lorsque j'essai d'appliquer la même chose sous Windev, impossible.
J'ai cru comprendre que l'on pouvait utiliser la dll dans notre logiciel de développement (ici, Windev) dans le cas ou celui ci supporte le "COM"

Ma question : comment faire cela sous windev ?

Merci


------------------- EXtrait du manuel PDFLib --------------------
2.3 COM Binding
2.3.1 How does the COM Binding work?
COM (Component Object Model)1 is a language-independent standard for interoperable
software components. The COM implementation of PDFlib is built as a DLL based on the
PDFlib core. The wrapper DLL calls the PDFlib core functions and is responsible for communicating
with the underlying COM machinery, registration and type library issues,
and COM exception handling. The PDFlib COM wrapper can technically be characterized
as follows (don’t worry if you are not familiar with all of these terms – they are not required
for using PDFlib):
> PDFlib acts as a Win32 in-process COM server component (also known as an automation
server) without any user interface.
PDFlib is a »both-threaded« component, i.e., it is treated as both an apartmentthreaded

as well as a free-threaded component. In addition, PDFlib aggregates a freethreaded
marshaller. In simple terms, clients can use the PDFlib object directly (instead
of going through a proxy/stub pair) which boosts performance.
The PDFlib binary pdflib_com.dll is a self-registering DLL with a type library.
PDFlib is stateless, i.e., method parameters are used instead of properties.
PDFlib’s dual interface supports both early and late binding.
PDFlib supports rich error information.

Note PDFlib is not MTS-aware (Microsoft Transaction Server), although it can be deployed with MTS.


2.3.2 Installing the PDFlib COM Edition
PDFlib can be deployed in all environments that support COM components.

------------------------------------------
Exemple de code VBS fourni :

Option Explicit

Dim font
Dim oPDF

Set oPDF = WScript.CreateObject("PDFlib_com.PDF")

if (oPDF.begin_document("hello.pdf", "") = -1) then
WScript.Echo "Error: " & oPDF.get_errmsg
WScript.Quit(1)
end if

oPDF.set_info "Creator", "hello.vbs"
oPDF.set_info "Author", "Thomas Merz"
oPDF.set_info "Title", "Hello, world (COM/WSH)!"

oPDF.begin_page_ext 595, 842, ""

font = oPDF.load_font("Helvetica-Bold", "unicode", "")

oPDF.setfont font, 24

oPDF.set_text_pos 50, 700
oPDF.show "Hello, world!"
oPDF.continue_text "(says COM/VBS)"

oPDF.end_page_ext ""
oPDF.end_document ""

Set oPDF = Nothing
Publicado el 30,noviembre 2004 - 13:29
Salut,
si c'est un objet com, voici comment procéder
bContinuer est un booleen = vrai
monobjet est un objet automation dynamique
QUAND EXCEPTION DANS
monbojet = allouer un objet automation "PDFlib_com.PDF"
FAIRE
ERREUR(ExceptionInfo(errComplet))
bcontinuer=faux
FIN
SI bcontinuer ALORS
SI oPDF>>begin_document("hello.pdf", "") = -1 ALORS
ERREUR(oPDF>>get_errmsg)
SINON
oPDF>>set_info("Creator", "hello.vbs")
...
FIN
FIN


Cela devrait fonctionner
Mathieu

"Benoît" <freeman.ben@wanadoo.fr> a écrit dans le message de news:
41ac8ce2$1@news.pcsoft.fr...

Bonjour,

Je viens d'acquérir la PDFLib. Je viens de regarder les exmples livré pour
fonctionner avec Delphi, VBS, VB, VBA,ASP mais lorsque j'essai d'appliquer
la même chose sous Windev, impossible.
J'ai cru comprendre que l'on pouvait utiliser la dll dans notre logiciel
de développement (ici, Windev) dans le cas ou celui ci supporte le "COM"

Ma question : comment faire cela sous windev ?

Merci


------------------- EXtrait du manuel PDFLib --------------------
2.3 COM Binding
2.3.1 How does the COM Binding work?
COM (Component Object Model)1 is a language-independent standard for
interoperable
software components. The COM implementation of PDFlib is built as a DLL
based on the
PDFlib core. The wrapper DLL calls the PDFlib core functions and is
responsible for communicating
with the underlying COM machinery, registration and type library issues,
and COM exception handling. The PDFlib COM wrapper can technically be
characterized
as follows (don't worry if you are not familiar with all of these terms -
they are not required
for using PDFlib):
PDFlib acts as a Win32 in-process COM server component (also known as an
automation
server) without any user interface.

PDFlib is a »both-threaded« component, i.e., it is treated as both an
apartmentthreaded
as well as a free-threaded component. In addition, PDFlib aggregates a

freethreaded
marshaller. In simple terms, clients can use the PDFlib object directly
(instead
of going through a proxy/stub pair) which boosts performance.
The PDFlib binary pdflib_com.dll is a self-registering DLL with a type
library.
PDFlib is stateless, i.e., method parameters are used instead of
properties.
PDFlib's dual interface supports both early and late binding.
PDFlib supports rich error information.
Note PDFlib is not MTS-aware (Microsoft Transaction Server), although it

can be deployed with MTS.


2.3.2 Installing the PDFlib COM Edition
PDFlib can be deployed in all environments that support COM components.

------------------------------------------
Exemple de code VBS fourni :

Option Explicit

Dim font
Dim oPDF

Set oPDF = WScript.CreateObject("PDFlib_com.PDF")

if (oPDF.begin_document("hello.pdf", "") = -1) then
WScript.Echo "Error: " & oPDF.get_errmsg
WScript.Quit(1)
end if

oPDF.set_info "Creator", "hello.vbs"
oPDF.set_info "Author", "Thomas Merz"
oPDF.set_info "Title", "Hello, world (COM/WSH)!"

oPDF.begin_page_ext 595, 842, ""

font = oPDF.load_font("Helvetica-Bold", "unicode", "")

oPDF.setfont font, 24

oPDF.set_text_pos 50, 700
oPDF.show "Hello, world!"
oPDF.continue_text "(says COM/VBS)"

oPDF.end_page_ext ""
oPDF.end_document ""

Set oPDF = Nothing