Methods



appendPageWithHTMLString:baseURL:

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

NameDescription
htmlStringNSString instance containing the HTML code to be appended.
baseURLThe 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.

appendPageWithURL:

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

NameDescription
urlThe URL pointing to the HTML document to be appended.

bottomMargin

- (float)bottomMargin; 

Result: The width of the bottom margin in points.

closeDocument

Abstract: Closes the previously created document, returning the pathname of the document.
- (NSString*)closeDocument; 

Result: The pathname of the PDF-document.

createDocument

Abstract: Creates a PDF document using A4 as its papersize and NSLandscapeOrientation as its orientation.
- (void)createDocument; 


createDocumentWithPaperName:orientation:

Abstract: Creates a PDF document with the given papername and orientation.
- (void)createDocumentWithPaperName:(NSString *)paperName orientation:(int)theOrientation; 

Parameters

NameDescription
paperNameThe name of the papersize to be used for this document.
theOrientationThe orientation to be used for this document. Possible values are either NSLandscapeOrientation or NSPortraitOrientation, both of which are defined in AppKit/NSPrintInfo.h

createDocumentWithPaperSize:orientation:

Abstract: Creates a PDF document with the given papersize and orientation.
- (void)createDocumentWithPaperSize:(NSSize)paperSize orientation:(int)theOrientation; 

Parameters

NameDescription
paperSizeThe papersize in points to be used for this document.
theOrientationThe orientation to be used for this document. Possible values are either NSLandscapeOrientation or NSPortraitOrientation, both of which are defined in AppKit/NSPrintInfo.h

dealloc

Abstract: deallocates a WebRendere instance, releasing all ivars.
- (void)dealloc; 


horizontalPagination

Abstract: Returns the horizontal pagination mode.
- (NSPrintingPaginationMode)horizontalPagination; 


init

Abstract: Designated initializer for WebRenderer instances.
- (id)init; 


leftMargin

- (float)leftMargin; 

Result: The width of the left margin in points.

orientation

- (NSPrintingOrientation)orientation; 

Result: The documents orientation, either NSPortraitOrientation or NSLandscapeOrientation as defined in AppKit/NSPrintInfo.h

paperName

Abstract: Returns the paper name, such as Letter or Legal. Paper names are implementation specific.
- (NSString*)paperName; 


paperSize

- (NSSize)paperSize; 

Result: The papersize in points currently used by this instance.

printScalingFactor

Abstract: Returns the scale factor percentage used before pagination.
- (float)printScalingFactor; 


printsHorizontallyCentered

Abstract: Returns the horizontal centration in effect.
- (BOOL)printsHorizontallyCentered; 


printsVerticallyCentered

Abstract: Returns the vertical centration in effect.
- (BOOL)printsVerticallyCentered; 


rightMargin

- (float)rightMargin; 

Result: The width of the right margin in points.

setBottomMargin:

Abstract: Sets the bottom margin to be used. This method does not affect pages already appended to the document.
- (void)setBottomMargin:(float)margin; 

Parameters

NameDescription
marginThe width of the bottom margin in points.

setHorizontalPagination:

Abstract: Sets the horizontal pagination to mode. mode can be one of NSAutoPagination, NSFitPagination or NSClipPagination.
- (void)setHorizontalPagination:(NSPrintingPaginationMode)mode; 


setLeftMargin:

Abstract: Sets the left margin to be used. This method does not affect pages already appended to the document.
- (void)setLeftMargin:(float)margin; 

Parameters

NameDescription
marginThe width of the left margin in points.

setOrientation:

Abstract: Changes the orientation used in converting HTML to PDF. Pages already converted are not affected by this call.
- (void)setOrientation:(NSPrintingOrientation)orientation; 

Parameters

NameDescription
orientationThe orientation to be used from now on, either NSPortraitOrientation or NSLandscapeOrientation as defined in AppKit/NSPrintInfo.h.

setPaperName:

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; 


setPaperSize:

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

NameDescription
sizeThe new papersize to be used in points.

setPrintScalingFactor:

Abstract: Sets the scale factor percentage used before pagination..
- (void)setPrintScalingFactor:(float)factor; 

Parameters

NameDescription
factorThe scale factor percentage.

setPrintsHorizontallyCentered:

Abstract: Sets horizontal centration of the rendered HTML on the PDF document.
- (void)setPrintsHorizontallyCentered:(BOOL)centered; 

Parameters

NameDescription
centeredIf YES, rendered HTML will be centered horizontally on the PDF document.

setPrintsVerticallyCentered:

Abstract: Sets vertical centration of the rendered HTML on the PDF document.
- (void)setPrintsVerticallyCentered:(BOOL)centered; 

Parameters

NameDescription
centeredIf YES, rendered HTML will be centered vertically on the PDF document.

setRightMargin:

Abstract: Sets the right margin to be used. This method does not affect pages already appended to the document.
- (void)setRightMargin:(float)margin; 

Parameters

NameDescription
marginThe width of the right margin in points.

setShouldPrintBackgrounds:

Abstract: Enables or disables the inclusion of backgrounds in the PDF document
- (void)setShouldPrintBackgrounds:(BOOL)value; 

Parameters

NameDescription
valueIf YES include backgrounds, otherwise do not include backgrounds.

setTopMargin:

Abstract: Sets the top margin to be used. This method does not affect pages already appended to the document.
- (void)setTopMargin:(float)margin; 

Parameters

NameDescription
marginThe width of the top margin in points.

setVerticalPagination:

Abstract: Sets the vertical pagination to mode. mode can be one of NSAutoPagination, NSFitPagination or NSClipPagination.
- (void)setVerticalPagination:(NSPrintingPaginationMode)mode; 


shouldPrintBackgrounds

- (BOOL)shouldPrintBackgrounds; 

Result: returns wether or not backgrounds will be printed

topMargin

- (float)topMargin; 

Result: The width of the top margin in points.

verticalPagination

Abstract: Returns the vertical pagination mode.
- (NSPrintingPaginationMode)verticalPagination; 


(Last Updated 3/3/2005)