Hi,
Could someone please give me an example (in VB/VB.NET/C#) of how to create pdf file containing a single image(a scan of an a4 page) which fills the entire page.
I am trying to use the following code, but when I try and open the file in Acrobat, I get the message: "Wrong Operand Type".
.AddPage(1)
.CreateObject(ObjectTypeConstants.acObjectTypePicture, "pic1")
.ObjectAttribute("pic1", "FileName") = "C:\testdoc.bmp"
.ObjectAttribute("pic1", "Page") = 1
.RedrawObject("pic1")
.Save("C:\AmyuniPDf.pdf",FileSaveOptionConstants.acFileSaveAll)
Hope someone can help
Thanks in advance,
Regards,
Chris.
Example of Image
-
- Posts: 21
- Joined: Tue Apr 29 2003
- Location: Montreal, Quebec
You have to set dimensions for your picture object :
.AddPage(1)
.CreateObject(ObjectTypeConstants.acObjectTypePicture, "pic1")
.ObjectAttribute("pic1", "FileName") = "C:\testdoc.bmp"
.ObjectAttribute("pic1", "Page") = 1
-- ADD THIS HERE
.ObjectAttribute("pic1", "LEFT") = 0
.ObjectAttribute("pic1", "TOP") = 0
.ObjectAttribute("pic1", "RIGHT") = Me.objPDF.PageWidth
.ObjectAttribute("pic1", "BOTTOM") = Me.objPDF.PageLength
-----------------------------------------------------
.RedrawObject("pic1")
.AddPage(1)
.CreateObject(ObjectTypeConstants.acObjectTypePicture, "pic1")
.ObjectAttribute("pic1", "FileName") = "C:\testdoc.bmp"
.ObjectAttribute("pic1", "Page") = 1
-- ADD THIS HERE
.ObjectAttribute("pic1", "LEFT") = 0
.ObjectAttribute("pic1", "TOP") = 0
.ObjectAttribute("pic1", "RIGHT") = Me.objPDF.PageWidth
.ObjectAttribute("pic1", "BOTTOM") = Me.objPDF.PageLength
-----------------------------------------------------
.RedrawObject("pic1")