Initialisation |
[Top] [Chapter] [Previous] [Next] |
Creating metafile with wPDFControl is as easy as 1 - 2 - 3 or better as
BeginDoc - DrawImage - EndDoc.
If you need a a "Graphics" object to draw to, you need to open a 'page' first. To open a PDF page use StartPage.
BeginDoc - StartPage - Canvas.DrawString(..) - EndPage - EndDoc.
Note: Using 'CloseCanvas' you can always flush the graphic output stored in the Canvas property to the PDF file.
To use registered version of PDFControl and RTF2PDF you need to execute the function SetLicense(String Name, String Code, uint Number) to pass your license name, the code and the number. This activates the PDF engine.
Note: You can also create a PDF document in a Stream object: Simply pass the a Stream instance to the function BeginDoc.
Overview:
BeginDoc/EndDoc
// Use this function to set your license information public bool SetLicense(String Name, String Code, uint Number)
// Use this function to start a new PDF file // using the filename set in property FileName public bool BeginDoc()
// Use this function to start a new PDF file using give filename public bool BeginDoc(String FileName)
// Use this function to start a new PDF stream (not a file) public bool BeginDoc(Stream OutStream)
// EndDoc closes a PDF file which has been opened with BeginDoc public void EndDoc()
StartPage/EndPage
// StartPage starts a new page in a PDF file opened with BeginDoc. // Y and Y are measured pt, this is 1 inch / 72 public bool StartPage(int w, int h, bool landscape)
// Starts a page to make that image exactly fit. You can sepcify a zooming value public bool StartPage(Image image, int ZoomValue)
// Starts a page with a certain ePage // format: Letter, Legal, Executive, DinA3, DinA4, DinA5 or DinA6 public bool StartPage(ePage format, bool landscape)
// Starts a page using the DefaultPageSize public bool StartPage()
// Closes a PDF page and writes it public void EndPage()
StartWatermark/EndWatermark
// Starts a watermark with a certain name // and ePage format: Letter, Legal, Executive, DinA3, DinA4, DinA5 or DinA6 public bool StartWatermark(String Name,ePage format)
// Starts a watermark with the DafaultPageSize and a certain name public bool StartWatermark(String Name)
/ Closes a PDF watermark and writes it public void EndWatermark()
|