Dim p As PDFlib_dotnet.PDFlib
Dim imagefile As String = "c:\test-image.jpg"
p = New PDFlib()
Dim o As String = "linearize"
p.set_parameter("errorpolicy", "return")
Dim previewfile As String = "c:\rotation_test.pdf"
Dim ok As Integer = p.begin_document(previewfile, o)
p.set_option("topdown=true")
Dim image = p.load_image("auto", imagefile, "")
p.begin_page_ext(400, 400, "")
Dim LocX As Double = 200
Dim LocY As Double = 200
Dim AW As Double = 100
Dim AH As Double = 100
Dim R As Double = 45
p.fit_image(image, LocX, LocY, "boxsize={" & AH & " " & AW & "} fitmethod=meet") ' TEST Placeholder
p.save()
p.translate(LocX + (AW / 2), LocY - (AH / 2))
p.rotate(R)
p.fit_image(image, ((AW / 2) - AW), -((AH / 2) - AH), "boxsize={" & AH & " " & AW & "} fitmethod=meet")
p.end_page_ext("")
p.end_document("")
p.Dispose()
p = Nothing