GdPicture.NET.14
GdPicture14 Namespace / GdPictureDocumentConverter Class / TxtPageHeight Property
Example





In This Topic
TxtPageHeight Property (GdPictureDocumentConverter)
In This Topic
Specifies the page height, in points, of the resulting document when converting from the source txt file. Default value is 842, which is the A4 document height.
Syntax
'Declaration
 
Public Property TxtPageHeight As Single
public float TxtPageHeight {get; set;}
public read-write property TxtPageHeight: Single; 
public function get,set TxtPageHeight : float
public: __property float get_TxtPageHeight();
public: __property void set_TxtPageHeight( 
   float value
);
public:
property float TxtPageHeight {
   float get();
   void set (    float value);
}

Property Value

The default value is 842.
Example
Converting a text file 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.TxtFontFamily = "Times New Roman";
    gdpictureDocumentConverter.TxtFontSize = 16;
    gdpictureDocumentConverter.TxtFontBold = true;
    gdpictureDocumentConverter.TxtFontItalic = false;
    gdpictureDocumentConverter.TxtHorizontalTextAlignment = TextAlignment.TextAlignmentCenter;
    gdpictureDocumentConverter.TxtPageHeight = 842; // A3 page size
    gdpictureDocumentConverter.TxtPageWidth = 1191;  // A3 page size
    gdpictureDocumentConverter.TxtPageMarginTop = 20;
    gdpictureDocumentConverter.TxtPageMarginBottom = 20;
    gdpictureDocumentConverter.TxtPageMarginLeft = 20;
    gdpictureDocumentConverter.TxtPageMarginRight = 20;
            
    using (Stream inputStream = File.Open("input.txt", System.IO.FileMode.Open))
    {
        using (Stream outputStream = File.Create("output.pdf"))
        {
            gdpictureDocumentConverter.ConvertToPDF(inputStream, GdPicture14.DocumentFormat.DocumentFormatTXT, outputStream, PdfConformance.PDF1_5);
        }
    }
}
See Also