This example shows how to draw one PDF into another. It takes a
PDF document and creates a 'four-up' summary document by drawing
four pages on each page of the new document.
First, we create an ABCpdf Doc object and read in our source
document.
Set theSrc = Server.CreateObject("ABCpdf11.Doc")
theSrc.Read "c:\mypdfs\spaceshuttle.pdf"
theCount = theSrc.PageCount
Next, we create a destination Doc object and set the MediaBox so that the page size
will match that of the source document. We change the rect so that
it occupies a quarter of the page with room to accommodate a small
margin.
Set theDst = CreateObject("ABCpdf11.Doc")
theDst.MediaBox = theSrc.MediaBox
theDst.Rect = theDst.MediaBox
theDst.Rect.Magnify 0.5, 0.5
theDst.Rect.Inset 10, 10
theX = theDst.MediaBox.Width / 2
theY = theDst.MediaBox.Height / 2
We go through every page in the source document drawing a framed
copy of each page at a different position on our four-up document.
After every fourth page, we add a new page into our destination
document.
For i = 1 To theCount
theItem = i Mod 4
If theItem = 1 Then
theDst.Page = theDst.AddPage()
theDst.Rect.Position 10, theY + 10
ElseIf theItem = 2 Then
theDst.Rect.Position theX + 10, theY +
10
ElseIf theItem = 3 Then
theDst.Rect.Position 10, 10
ElseIf theItem = 0 Then
theDst.Rect.Position theX + 10, 10
End If
theDst.AddImageDoc theSrc, i, ""
theDst.FrameRect
Next
Finally, we save.
theDst.Save "c:\mypdfs\fourup.pdf"
We get the following output.

fourup.pdf [Page 1] |

fourup.pdf [Page 2] |
|