1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| Option Explicit
Sub Tst_AjoutTexteLigneHirondelles()
Dim pdf As Object, pdfText As Object, pdfLine As Object, pdfLine2 As Object
Dim sNomDoc As String
Set pdf = CreateObject("pdfforge.pdf.pdf")
Set pdfText = CreateObject("pdfforge.pdf.pdfText")
Set pdfLine = CreateObject("pdfforge.pdf.pdfline")
Set pdfLine2 = CreateObject("pdfforge.pdf.pdfline")
sNomDoc = ThisWorkbook.Path & "\" & "Document.pdf"
With pdfText
.fillOpacity = 1
.FontColorBlue = 62
.FontColorGreen = 125
.FontColorRed = 255
.FontName = "comic.TTF"
.FontSize = 55
.Rotation = 45
.Text = "Essai Essai Essai Essai Essai"
.XPosition = 25
.YPosition = 100
'Public Function AddTextToPDFFile( _
' sourceFilename As String, _
' destinationFilename As String, _
' fromPage As Integer, _
' toPage As Integer, _
' ByRef textObject As pdfText _
') As Integer
pdf.AddTextToPDFFile sNomDoc, "AddText.pdf", 1, 1, pdfText
End With
With pdfLine
.FromX = 25
.FromY = 95
.ToX = .FromX + 180
.ToY = .FromY + 180
.LineColorRed = 60
.LineColorGreen = 125
.LineColorBlue = 255
.LineThickness = 4
.UnitsOn = 5
.UnitsOff = 2.5
.Phase = 5
'Public Function AddLineToPDFFile( _
' sourceFilename As String, _
' destinationFilename As String, _
' fromPage As Integer, _
' toPage As Integer, _
' ByRef lineObject As pdfLine _
') As Integer
pdf.AddLineToPDFFile "AddText.pdf", "AddTextLine.pdf", 1, 1, pdfLine
End With
With pdfLine2
.UnitsOn = 5
.UnitsOff = 0
'Public Function AddCropMarksToPDFFile( _
' sourceFilename As String, _
' destinationFilename As String, _
' fromPage As Integer, _
' toPage As Integer, _
' borderTopMillimeter As Single, _
' borderBottomMillimeter As Single, _
' borderLeftMillimeter As Single, _
' borderRightMillimeter As Single, _
' ByRef lineObject As pdfLine _
') As Integer
pdf.AddCropMarksToPDFFile "AddTextLine.pdf", "AddTextLineCrop.pdf", 1, 0, 5, 5, 5, 5, pdfLine2
End With
Set pdfLine2 = Nothing
Set pdfLine = Nothing
Set pdfText = Nothing
Set pdf = Nothing
End Sub |
Partager