Le script
► Afficher le texte
Code : Tout sélectionner
#include <MPDF_UDF.au3>
;set the properties for the pdf
_SetTitle("Asso volants")
_SetSubject("Facture")
_SetKeywords("f")
_OpenAfter(True);open after generation
_SetUnit($PDF_UNIT_CM)
_SetPaperSize("A4")
_SetZoomMode($PDF_ZOOM_CUSTOM,90)
_SetOrientation($PDF_ORIENTATION_PORTRAIT)
_SetLayoutMode($PDF_LAYOUT_CONTINOUS)
;initialize the pdf
_InitPDF(@ScriptDir & "\essai_facture.pdf")
;=== load resources used in pdf ===
;images:
_LoadResImage("taxi", @ScriptDir & "\logo.jpg")
;_LoadFontStandard("_Times", $PDF_FONT_STD_TIMES)
_LoadFontTT("_Arial", $PDF_FONT_ARIAL)
_LoadFontTT("_TimesT", $PDF_FONT_TIMES)
_LoadFontTT("_Calibri", $PDF_FONT_CALIBRI)
_LoadFontTT("_Garamond", $PDF_FONT_GARAMOND)
;_LoadFontTT("_Symbol", $PDF_FONT_SYMBOL)
;=== create objects that are used in multiple pages ===
;create a header on all pages, except the first:
_StartObject("Entete", $PDF_OBJECT_ALLPAGES);NOTFIRSTPAGE)
;insert a image already loaded
_InsertImage("taxi", 0.4, 23, 4, 6)
;change the colour of the text that follows
_SetColourFill(0x323232)
;stretch it a bit, down to 90%
_SetTextHorizontalScaling(100)
;and begin writting some data
_SetColourFill("0x0000FF"); 0xFF00FF=rose 0x0000FF=bleu
_DrawText(12, 28, "Association les Volants", "_Arial", 24, $PDF_ALIGN_CENTER);StringUpper("Et adipiscing nec nisi elementum natoque!")
_DrawText(12, 27, "Accociation loi 1901", "_Arial", 12, $PDF_ALIGN_CENTER)
_DrawText(12, 25.5, "5, rue Victor Hugo", "_Arial", 14, $PDF_ALIGN_CENTER)
_DrawText(12, 24.5, "75011, PARIS", "_Arial", 14, $PDF_ALIGN_CENTER)
_DrawText(12, 23.5, "Téléphone / Fax / Répondeur : +33-1 23 45 67 89", "_Arial", 8, $PDF_ALIGN_CENTER)
;get the scalling back to default value
;_SetTextHorizontalScaling(100)
;and colour also
_SetColourFill(0)
;that's the end of our header!
_EndObject()
;start a page
_BeginPage()
_EndPage()
;then, finally, write the buffer to disk
_ClosePDFFile()
"Té--------------------------lé" sur le Pdf généré. (les tirets remplacent les espaces qui ne sont pas affichés en HTML !!!)
Je joins, en attaché, l'UDF
Merci
NovembreZoulou