Example





In This Topic

HtmlPageWidth Property (GdPictureDocumentConverter)

In This Topic
Specifies the page width, in points, of the resulting document when converting from the source html file. The default value is 1440.
Syntax
'Declaration

 

Public Property HtmlPageWidth As Single
public float HtmlPageWidth {get; set;}
public read-write property HtmlPageWidth: Single; 
public function get,set HtmlPageWidth : float
public: __property float get_HtmlPageWidth();

public: __property void set_HtmlPageWidth( 

   float value

);
public:

property float HtmlPageWidth {

   float get();

   void set (    float value);

}

Property Value

The default value is 1440.
Example
Converting an HTML page to a PDF document specifying custom properties for the layout of the resulting document.
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())

{

    // Set the text and document properties to be used for the resulting file.

    gdpictureDocumentConverter.HtmlPageHeight = 842; // A3 page size

    gdpictureDocumentConverter.HtmlPageWidth = 1191;  // A3 page size

    gdpictureDocumentConverter.HtmlPageMarginTop = 10;

    gdpictureDocumentConverter.HtmlPageMarginBottom = 10;

    gdpictureDocumentConverter.HtmlPageMarginLeft = 10;

    gdpictureDocumentConverter.HtmlPageMarginRight = 10;

            

    using (Stream inputStream = File.Open("input.html", System.IO.FileMode.Open))

    {

        using (Stream outputStream = File.Create("output.pdf"))

        {

            gdpictureDocumentConverter.ConvertToPDF(inputStream, GdPicture14.DocumentFormat.DocumentFormatHTML, outputStream, PdfConformance.PDF1_5);

        }

    }

}
See Also