<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Samples.Master" CodeBehind="pdf-resize.aspx.vb" Inherits="SelectPdf.Samples.pdf_resize" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>SelectPdf for .NET - Pdf Resize/Scale Content - VB.NET / ASP.NET</title>
    <meta name="description" content="SelectPdf Pdf Resize Sample for VB.NET / ASP.NET. Pdf Library for .NET with full sample code in C# and VB.NET." itemprop="description">
    <meta name="keywords" content="pdf resize, pdf scale, pdf margins, pdf library, sample code, html to pdf, pdf converter" itemprop="keywords">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">
        <article class="post type-post status-publish format-standard hentry">
            <header class="entry-header">
                <h1 class="entry-title">SelectPdf for .NET - Pdf Resize/Scale Content - VB.NET / ASP.NET Sample</h1>
            </header>
            <!-- .entry-header -->

            <div class="entry-content">
                <p>
                    This sample shows how to use SelectPdf Library for .NET to resize the pages of an existing PDF document, add margins, change page orientation.
                    That can be done keeping the aspect ratio of the content or not, allowing scaling or not.
                </p>
                <p>
                    The sample uses the following (existing) test PDF:<br />
                    <a href="files/selectpdf.pdf" target="_blank">Test PDF document</a><br />
                    <br />
                    The file has A4 pages, Portrait orientation, 5pt margins.
                </p>
                <p>
                    <b>Resize settings</b>
                    <br />
                    The new file will have the following settings:<br />
                    <i>(Note: Margins bellow are added to the existing margins. Alignments are only taken into account if the scaling is allowed and the aspect ratio is preserved.)</i>
                </p>
                <div class="col4">
                    Pdf Page Size:<br />
                    <asp:DropDownList ID="DdlPageSize" runat="server">
                        <asp:ListItem Text="A1" Value="A1"></asp:ListItem>
                        <asp:ListItem Text="A2" Value="A2"></asp:ListItem>
                        <asp:ListItem Text="A3" Value="A3"></asp:ListItem>
                        <asp:ListItem Text="A4" Value="A4" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="A5" Value="A5"></asp:ListItem>
                        <asp:ListItem Text="Letter" Value="Letter"></asp:ListItem>
                        <asp:ListItem Text="HalfLetter" Value="HalfLetter"></asp:ListItem>
                        <asp:ListItem Text="Ledger" Value="Ledger"></asp:ListItem>
                        <asp:ListItem Text="Legal" Value="Legal"></asp:ListItem>
                    </asp:DropDownList><br />
                    <br />
                    Pdf Page Orientation:<br />
                    <asp:DropDownList ID="DdlPageOrientation" runat="server">
                        <asp:ListItem Text="Portrait" Value="Portrait" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Landscape" Value="Landscape"></asp:ListItem>
                    </asp:DropDownList><br />
                    <br />
                </div>

                <div class="col4">
                    Top Margin:<br />
                    <asp:TextBox ID="TxtTopMargin" runat="server" Width="20px" Text="0"></asp:TextBox> pt<br />
                    <br />
                    Right Margin:<br />
                    <asp:TextBox ID="TxtRightMargin" runat="server" Width="20px" Text="0"></asp:TextBox> pt<br />
                    <br />
                    <asp:CheckBox ID="ChkAllowScaling" runat="server" Checked="true" Text="Allow Scaling" />
                </div>

                <div class="col4">
                    Bottom Margin:<br />
                    <asp:TextBox ID="TxtBottomMargin" runat="server" Width="20px" Text="0"></asp:TextBox> pt<br />
                    <br />
                    Left Margin:<br />
                    <asp:TextBox ID="TxtLeftMargin" runat="server" Width="20px" Text="0"></asp:TextBox> pt<br />
                    <br />
                    <asp:CheckBox ID="ChkKeepAspectRatio" runat="server" Checked="true" Text="Keep Aspect Ratio" />
                </div>

                <div class="col4">
                    Horizontal Alignment:<br />
                    <asp:DropDownList ID="DdlHorizontalAlign" runat="server">
                        <asp:ListItem Text="Left" Value="Left"></asp:ListItem>
                        <asp:ListItem Text="Center" Value="Center" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Right" Value="Right"></asp:ListItem>
                    </asp:DropDownList><br />
                    <br />
                    Vertical Alignment:<br />
                    <asp:DropDownList ID="DdlVerticalAlign" runat="server">
                        <asp:ListItem Text="Top" Value="Top"></asp:ListItem>
                        <asp:ListItem Text="Middle" Value="Middle" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Bottom" Value="Bottom"></asp:ListItem>
                    </asp:DropDownList><br />
                    <br />
                </div>

                <div class="col-clear"></div>
                <p>
                    <asp:Button ID="BtnCreatePdf" runat="server" Text="Create PDF" OnClick="BtnCreatePdf_Click" CssClass="mybutton" />
                </p>
            </div>
            <!-- .entry-content -->
        </article>
        <!-- #post -->
</asp:Content>
