Dim pdf
Dim newpdf
Dim pdfstamp
Dim x
Dim y
Dim page
Dim r_left
Dim r_top
Dim r_width
Dim r_height
Dim savepath
savepath = "d:\newpdf.pdf"
newpdf="d:\bla.pdf"
pdfstamp1="d:\07FO02G1x.pdf"
pdfstamp2="d:\image4.bmp.pdf"
Set pdf = CreateObject("aloahapdf.edit")
'Create a blank PDF in A4 Format (default)
'Syntax create_new_pdf(clng(PointsX), clng(pointsY), cstr(PDF_Author), cstr(PDF_Subject), cstr(PDF_Keywords), cstr(PDF_Title)) As Boolean
If pdf.create_new_pdf(0,0, "", "", "", "") = true Then
Call pdf.save_pdf_to_file(CStr(newpdf))
End If
If pdf.load_pdf_to_mem(CStr(newpdf)) = true Then
'work with first page
page = CLng(1)
'read x/y dimensions of loaded PDF document
x=CDbl(pdf.XDimension(CLng(page)))
y=CDbl(pdf.YDimension(CLng(page)))
'define x/y position of pdf to be placed (in points)
r_left=300
r_top=300
r_width=100
r_height=100
If pdf.Place_PDF_as_Image(CStr(pdfstamp1), CLng(page), CDbl(r_left), CDbl(r_Top), CDbl(r_width), CDbl(r_height)) = true Then
'continue to work with the following page
page=pdf.totalpages+1
'append blank page to PDF document
Call pdf.append_blank
'define new position
r_left=200
r_top=500
r_width=150
r_height=150
If pdf.Place_PDF_as_Image(CStr(pdfstamp2), CLng(page), CDbl(r_left), CDbl(r_Top), CDbl(r_width), CDbl(r_height)) = true Then
Call pdf.save_pdf_to_file(CStr(savepath))
End If
End If
End If
Set pdf = nothing
Download PDF SDK here!Please contact aloaha@wrocklage.de for a free evaluation key! |
Create Custom Page Size PDFLearn here how to create custom page size PDF Document to be used as PDF blocks in this API. |
