PDF Metamorphosis .Net - Powerful .Net component to convert RTF to PDF, HTML to PDF, Text to PDF, split and merge PDFs.
version 2.2.2 (March 17th, 2008)
   HelpContent | About PDF Metamorphosis .Net| Methods and properties | Samples of using in C#, VB.Net, ASP.Net| License | Pricing | Support and Contanst

PDF Metamorphosis .Net - methods and properties description

The component can convert files(strings) into Pdf files (strings) with images, tables, CSS etc.
This scheme shows all methods and properties of DLL, but you can use not all of members, because all of them is already set by default to make conversion more precision.

Methods:

Work in ASP.Net web-applications and Win Forms:

 RtfToPdfConvertString()
 RtfToPdfConvertFile()
 RtfToPdfConvertFileToString()
 RtfToPdfConvertStringToFile()

 HtmlToPdfConvertFile()
 HtmlToPdfConvertFileToString()
 HtmlToPdfConvertString()
 HtmlToPdfConvertStringToFile()

 PdfSplit()
 PdfMerge()
 
Properties:
(only for converting to PDF)
PageStyle parameters:
 PageSize
 PageOrientation
 PageMarginLeft
 PageMarginRight
 PageMarginTop
 PageMarginBottom
 PageNumFormat

TextStyle parameters:

 FontFace
 FontSize
 FontColor
 TextAlignment


HtmlOptions parameters:

 Header
 Footer
 ImageFolder

 License activation
 
Error parameters:

 ErrorTrace

 
   
   
   
   
string RtfToPdfConvertString(string rtfString) - this method takes RTF string and returns PDF string.
Example:
			string rtfString = @"{\rtf1{\fonttbl{\f0 Courier;}}\f0\fs24 Hello word\par}";
string pdfString = "";

//create object (instance) of rtf2pdf converter
SautinSoft.PdfMetamorphosis p = new SautinSoft.PdfMetamorphosis();
if (p!=null)
{
//set converter options (not required)
p.TextStyle.FontSize = 50;
p.PageStyle.PageSize.Letter(); p.Serial = "0000000000"; //convert strings
pdfString = p.RtfToPdfConvertString(rtfString);
System.Console.WriteLine(rtfString);
}
int RtfToPdfConvertFile(string inputFileRtf, string outputFilePdf) - this method converts Rtf file  into PDF file.
return values:
0 - converting OK
1 - can't open RTF file 2 - can't create PDF file
3 - not enough memory (error converting)
Example: //create object (instance) of rtf2pdf converter
SautinSoft.PdfMetamorphosis p = new SautinSoft.PdfMetamorphosis();
//set converter options (not required) p.TextStyle.FontSize = 50; p.PageStyle.PageSize.Letter(); p.Serial = "0000000000";
//convert file int convertCode = p.RtfToPdfConvertFile("C:\\onputFile.rtf","C:\\outputFile.pdf"); if (convertCode == 0) System.Console.WriteLine("Converting Ok"); else System.Console.WriteLine(
"Converting Error");
string RtfToPdfConvertFileToString(string rtfFile) - this method takes path to RTF file and returns PDF string.

int RtfToPdfConvertStringToFile(string rtfString, string pdfFile) - this method takes RTF string and path to output PDF file.You may adjust the component and output PDF file will look as you wish.



int HtmlToPdfConvertFile(string inputFileName, string outputFileName) - this method converts Html file into PDF file.

return values:

0 - converting OK

1 - can't open Html file

2 - can't create PDF file

3 - not enough memory (error converting)

string HtmlToPdfConvertFileToString(string inputFileName) - this method takes path to Html file and returns PDF string.

string HtmlToPdfConvertString(string inputString) - this method takes Html string and returns PDF string.

int HtmlToPdfConvertStringToFile(string inputString, string outputFileName)- this method takes Html string and path to output PDF file.You may adjust the component and output PDF file will look as you wish..



int PdfSplit(string SourceFile, string OutputPath) - this method splits file SourceFile to some PDF files into directory OutputPath. The files each have contains one page of Source File. The OutputPath will contain files with number equal to count of pages in the SourceFile.

int PdfMerge(string[] Files, string DestFile)- this method merges all PDF files from Files array to new file DestFile.


FontFace - default font face
Possible values: TimesNewRoman, Helvetica, Courier, Auto.
Default value: Auto

Example: p.TextStyle.FontFace.Auto();


Example:
p.TextStyle.FontFace.Helvetica();

FontSize - default font size
Possible values: Any size, 0 - Auto
Default value: 0 or Auto

Example: p.TextStyle.FontSize = 0;

Example: p.TextStyle.FontSize = 12;

 

TextAlignment - default page alignment
Possible values:
Left, Center, Right, Justify, Auto.
Default value: Auto
Example:
p.TextStyle.TextAligment.Auto();

Example: p.TextStyle.TextAligment.Left();

FontColor - keep font color as in HTML

Possible values: Any size, 0 - Auto
Default value: 0 or Auto

Example: p.TextStyle.FontColor.Auto();

Example: p.TextStyle.FontColor.SetRGB(0,0,0);

PageSize - select page size

Possible values: A3, A4, A5, A6, B5, B5Jis, B5Iso, Folio, Statement, Letter, Legal, Executive, Oficio2, Auto
Default value: Auto
Example: p.PageStyle.PageSize.Legal();
or
p.PageStyle.PageSize.Widthmm(240.5);
p.PageStyle.PageSize.HeightInch(14.0);

PageOrientation - select page orientation: Portrait or Landscape

Possible values: Portrait, Landscape, Auto
Default value: Auto
Example: p.PageStyle.PageOrientation.Landscape();

pageMarginLeft, pageMarginRight, pageMarginTop, pageMarginBottom - set page margins

Possible values: any value in inches or mm
Default values: Auto;

Example:
p.PageStyle.PageMarginLeft.Inch(1.5);
p.PageStyle.PageMarginRight.mm(20);

PageNumFormat - page number format

Possible values: any string value with keywords
Default values: empty string;

Example:
p.PageStyle.PageNumFormat = "";
p.PageStyle.PageNumFormat = "{none}";

p.PageStyle.PageNumFormat = "{page} - {numpages}";
p.PageStyle.PageNumFormat = "Page {page} of {numpages}";

Notes:
The string PageStyle.PageNumFormat may consists of any symbols and keywords:
   {none} - page number doesn't visible;
   {page} - page number;
   {numpages} - total pages.
If value is empty then same as in Rtf file.

Header - put text in RTF page header (unlimited symbols max)

Possible values: any string
Default value: ""
Example:
p.HtmlOptions.Header = "Page Header Example ";

Footer - put text in RTF page footer (unlimited symbols max)

Possible values: any string
Default value: ""
Example:
p.HtmlOptions.Header = "Page Footer Example ";

ImageFolder - specify folder where HTML document refers (only for methods HtmlToPdfComvertString and HtmlToPdfConvertStringToFile)

Possible values: directory
Default value: ""
Example:
p.HtmlOptions.ImageFolder = "d:\HTML\Images\";

Serial - This property is required for activation full version. After purchasing you will get the full version and license key. Use it for activation. The trial version doesn't support this property.

Possible values: any value in key
Default values: "";

Example:
p.Serial = "0000000000";

ErrorTrace - this parameter helps to find detailed information about appeared error. This is standard object of System.Exception class.

Example:
string issue = p.ErrorTrace.Message;