Methods
Abstract: Converts the given HTML to PDF and appends
the result to the PDF document being generated by this WebRenderer instance.
- (void)appendPageWithHTMLString:(NSString *)htmlString baseURL:(NSURL *)baseURL;
Parameters
| Name | Description |
| htmlString | NSString instance containing the HTML code to be appended. |
| baseURL | The base-URL to be used. The given HTML code might refer to external
resources. The given url is used as base-url to resolve URL's within the HTML code. |
Abstract: Retrieves the given HTML document, converts it to PDF and appends
the result to the PDF document being generated by this WebRenderer instance.
- (void)appendPageWithURL:(NSURL *)url;
Parameters
| Name | Description |
| url | The URL pointing to the HTML document to be appended. |
- (float)bottomMargin;
Result: The width of the bottom margin in points.
Abstract: Closes the previously created document, returning the pathname of the document.
- (NSString*)closeDocument;
Result: The pathname of the PDF-document.
Abstract: Creates a PDF document using A4 as its papersize and NSLandscapeOrientation as its orientation.
- (void)createDocument;
Abstract: Creates a PDF document with the given papername and orientation.
- (void)createDocumentWithPaperName:(NSString *)paperName orientation:(int)theOrientation;
Parameters
| Name | Description |
| paperName | The name of the papersize to be used for this document. |
| theOrientation | The orientation to be used for this document. Possible values are either
NSLandscapeOrientation or NSPortraitOrientation, both of which are defined in AppKit/NSPrintInfo.h |
Abstract: Creates a PDF document with the given papersize and orientation.
- (void)createDocumentWithPaperSize:(NSSize)paperSize orientation:(int)theOrientation;
Parameters
| Name | Description |
| paperSize | The papersize in points to be used for this document. |
| theOrientation | The orientation to be used for this document. Possible values are either
NSLandscapeOrientation or NSPortraitOrientation, both of which are defined in AppKit/NSPrintInfo.h |
Abstract: deallocates a WebRendere instance, releasing all ivars.
- (void)dealloc;
Abstract: Returns the horizontal pagination mode.
- (NSPrintingPaginationMode)horizontalPagination;
Abstract: Designated initializer for WebRenderer instances.
- (id)init;
- (float)leftMargin;
Result: The width of the left margin in points.
- (NSPrintingOrientation)orientation;
Result: The documents orientation, either NSPortraitOrientation or NSLandscapeOrientation as
defined in AppKit/NSPrintInfo.h
Abstract: Returns the paper name, such as Letter or Legal. Paper names are implementation specific.
- (NSString*)paperName;
- (NSSize)paperSize;
Result: The papersize in points currently used by this instance.
Abstract: Returns the scale factor percentage used before pagination.
- (float)printScalingFactor;
Abstract: Returns the horizontal centration in effect.
- (BOOL)printsHorizontallyCentered;
Abstract: Returns the vertical centration in effect.
- (BOOL)printsVerticallyCentered;
- (float)rightMargin;
Result: The width of the right margin in points.
Abstract: Sets the bottom margin to be used. This method does not affect pages already appended to the document.
- (void)setBottomMargin:(float)margin;
Parameters
| Name | Description |
| margin | The width of the bottom margin in points. |
Abstract: Sets the horizontal pagination to mode. mode can be one of
NSAutoPagination, NSFitPagination or NSClipPagination.
- (void)setHorizontalPagination:(NSPrintingPaginationMode)mode;
Abstract: Sets the left margin to be used. This method does not affect pages already appended to the document.
- (void)setLeftMargin:(float)margin;
Parameters
| Name | Description |
| margin | The width of the left margin in points. |
Abstract: Changes the orientation used in converting HTML to PDF. Pages already converted are
not affected by this call.
- (void)setOrientation:(NSPrintingOrientation)orientation;
Parameters
| Name | Description |
| orientation | The orientation to be used from now on, either NSPortraitOrientation or
NSLandscapeOrientation as defined in AppKit/NSPrintInfo.h. |
Abstract: Sets the paper name to name (for example, A4 or Legal).
Paper names are implementation specific. This method may change either the size or orientation for consistency.
- (void)setPaperName:(NSString*)name;
Abstract: Sets the papersize to be used from now on. Plase note that this allows the PDf document to
consist of multiple pages with different sizes.
- (void)setPaperSize:(NSSize)size;
Parameters
| Name | Description |
| size | The new papersize to be used in points. |
Abstract: Sets the scale factor percentage used before pagination..
- (void)setPrintScalingFactor:(float)factor;
Parameters
| Name | Description |
| factor | The scale factor percentage. |
Abstract: Sets horizontal centration of the rendered HTML on the PDF document.
- (void)setPrintsHorizontallyCentered:(BOOL)centered;
Parameters
| Name | Description |
| centered | If YES, rendered HTML will be centered horizontally on the PDF document. |
Abstract: Sets vertical centration of the rendered HTML on the PDF document.
- (void)setPrintsVerticallyCentered:(BOOL)centered;
Parameters
| Name | Description |
| centered | If YES, rendered HTML will be centered vertically on the PDF document. |
Abstract: Sets the right margin to be used. This method does not affect pages already appended to the document.
- (void)setRightMargin:(float)margin;
Parameters
| Name | Description |
| margin | The width of the right margin in points. |
Abstract: Enables or disables the inclusion of backgrounds in the PDF document
- (void)setShouldPrintBackgrounds:(BOOL)value;
Parameters
| Name | Description |
| value | If YES include backgrounds, otherwise do not include backgrounds. |
Abstract: Sets the top margin to be used. This method does not affect pages already appended to the document.
- (void)setTopMargin:(float)margin;
Parameters
| Name | Description |
| margin | The width of the top margin in points. |
Abstract: Sets the vertical pagination to mode. mode can be one of
NSAutoPagination, NSFitPagination or NSClipPagination.
- (void)setVerticalPagination:(NSPrintingPaginationMode)mode;
- (BOOL)shouldPrintBackgrounds;
Result: returns wether or not backgrounds will be printed
- (float)topMargin;
Result: The width of the top margin in points.
Abstract: Returns the vertical pagination mode.
- (NSPrintingPaginationMode)verticalPagination;
(Last Updated 3/3/2005)