ScrollWindow Method

The ScrollWindow method can be used to scroll the document window by HorzScroll and VertScroll increments.

 

Syntax

VB:

Sub ScrollWindow(HorzScroll As Integer, VertScroll As Integer)

C#:

void ScrollWindow(int HorzScroll, int VertScroll)

C++:

HRESULT ScrollWindow(long HorzScroll, long VertScroll)

 

Parameters

HorzScroll

The amount to scroll horizontally in pixels.

VertScroll

The amount to scroll vertically in pixels.

 

Example

Public Class Form1

    Friend WithEvents AxPDFCreactiveX1 As AxACPDFCREACTIVEX.AxPDFCreactiveX = New AxACPDFCREACTIVEX.AxPDFCreactiveX()

 

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Me.Size = New System.Drawing.Size(400, 500)

 

        ' AxPDFCreactiveX1

        AxPDFCreactiveX1.Enabled = True

        AxPDFCreactiveX1.Location = New System.Drawing.Point(20, 20)

        AxPDFCreactiveX1.Name = "AxPDFCreactiveX1"

        AxPDFCreactiveX1.Parent = Me

        AxPDFCreactiveX1.Size = New System.Drawing.Size(360, 400)

        AxPDFCreactiveX1.TabIndex = 0

 

        ' Constants for Activation codes

        Const strLicenseTo As String = "Amyuni PDF Creator Evaluation"

        Const strActivationCode As String = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC"

 

        ' Set license key

        AxPDFCreactiveX1.SetLicenseKey(strLicenseTo, strActivationCode)

 

        ' Set CurrentPage

        pdf.CurrentPage = 1

 

        ' Create a Text in the current Page

        AxPDFCreactiveX1.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeText, "Text1")

 

        ' Define Object

        Dim oText As ACPDFCREACTIVEX.IacObject = AxPDFCreactiveX1.GetObjectByName("Text1")

        oText("Left") = 1000

        oText("Right") = 5000

        oText("Top") = 0

        oText("Bottom") = 4000

        oText("BorderColor") = &HFF00FF

        oText("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthDouble

        oText("Text") = "Amyuni Technologies"

 

        ' Create a Barcode in the current Page

        AxPDFCreactiveX1.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeBarcode, "Barcode1")

        Dim oBarCode As ACPDFCREACTIVEX.IacObject = AxPDFCreactiveX1.GetObjectByName("Barcode1")

        oBarCode("Left") = 100

        oBarCode("Right") = 3100

        oBarCode("Top") = 1000

        oBarCode("Bottom") = 2100

        oBarCode("BarcodeType") = 1  ' PDF417 barcodes are the only type supported

        oBarCode("VerticalScale") = 3.0  ' Amount by which To scale the barcode vertically, Default

        oBarCode("Text") = "Copyright 2015 Amyuni Technologies"

 

        '  scroll the window by 1 inch both vertically

        '  And horizontally

        AxPDFCreactiveX1.ScrollWindow(72, 72)

 

        ' Save PDF

        AxPDFCreactiveX1.Save("c:\temp\CreatePDFDocument_resulting.pdf", ACPDFCREACTIVEX.FileSaveOptionConstants.acFileSaveView)

 

 

        oBarCode = Nothing

    End Sub

End Class

public partial class Form1 : Form

{

    AxACPDFCREACTIVEX.AxPDFCreactiveX axPDFCreactiveX1 = new AxACPDFCREACTIVEX.AxPDFCreactiveX();

 

    public Form1()

    {

        InitializeComponent();

    }

 

    private void Form1_Load(object sender, EventArgs e)

    {

        this.Size = new System.Drawing.Size(400, 500);

 

        // AxPDFCreactiveX1

        axPDFCreactiveX1.Enabled = true;

        axPDFCreactiveX1.Location = new System.Drawing.Point(20, 20);

        axPDFCreactiveX1.Name = "AxPDFCreactiveX1";

        axPDFCreactiveX1.Parent = this;

        axPDFCreactiveX1.Size = new System.Drawing.Size(360, 400);

        axPDFCreactiveX1.TabIndex = 0;

 

        // Constants for Activation codes

        const string strLicenseTo = "Amyuni PDF Creator Evaluation";

        const string strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC";

 

        // Set license key

        axPDFCreactiveX1.SetLicenseKey(strLicenseTo, strActivationCode);

 

        // Set CurrentPage

        pdf.CurrentPage = 1;

 

        // Create a Text in the current Page

        axPDFCreactiveX1.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeText, "Text1");

        ACPDFCREACTIVEX.IacObject oText = axPDFCreactiveX1.GetObjectByName("Text1".ToString());

        oText["Left"] = 1000;

        oText["Right"] = 5000;

        oText["Top"] = 0;

        oText["Bottom"] = 4000;

        oText["BorderColor"] = 0xFF00FF;

        oText["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthDouble;

        oText["Text"] = "Amyuni Technologies";

 

        // Create a Barcode in the current Page

        axPDFCreactiveX1.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeBarcode, "Barcode1");

        ACPDFCREACTIVEX.IacObject oBarCode = axPDFCreactiveX1.GetObjectByName("Barcode1".ToString());

        oBarCode["Left"] = 100;

        oBarCode["Right"] = 3100;

        oBarCode["Top"] = 1000;

        oBarCode["Bottom"] = 2100;

        oBarCode["BarcodeType"] = 1;  // PDF417 barcodes are the only type supported

        oBarCode["VerticalScale"] = 3.0;  // Amount by which to scale the barcode vertically, default

        oBarCode["Text"] = "Copyright 2015 Amyuni Technologies";

 

        //  scroll the window by 1 inch both vertically

        //  and horizontally

        axPDFCreactiveX1.ScrollWindow(72, 72);

 

        // Save PDF

        axPDFCreactiveX1.Save(@"c:\temp\CreatePDFDocument_resulting.pdf", ACPDFCREACTIVEX.FileSaveOptionConstants.acFileSaveView);

 

 

        oBarCode = null;

    }

}

#import "c:\users\amyuni\pdfcreactivex.dll" no_namespace

 

using namespace std;

 

void main()

{

    IPDFCreactiveXPtr m_PDF;

 

    // TODO: Add extra initialization here

    m_PDF = GetDlgItem(IDC_PDFCREACTIVEX1)->GetControlUnknown();

 

    // Constants for Activation codes

    bstr_t strLicenseTo = "Amyuni PDF Creator Evaluation";

    bstr_t strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC";

 

    // set license key

    m_PDF->SetLicenseKey(_bstr_t(strLicenseTo), _bstr_t(strActivationCode));

 

    // Set CurrentPage

    pdf->CurrentPage = 1;

 

    // Set-up variables for attributes

    _variant_t varAttribute;

    varAttribute.vt = VT_I4;  // integers

 

                              // Create a text in the current Page

    m_PDF->CreateObject(acObjectTypeText, "Text1");

    IacObjectPtr oText = m_PDF->GetObjectByName("Text1");

    oText->Attribute["Left"] = 1000;

    oText->Attribute["Right"] = 5000;

    oText->Attribute["Top"] = 0;

    oText->Attribute["Bottom"] = 4000;

    varAttribute.lVal = 0xFF00FF;

    oText->Attribute["BorderColor"] = varAttribute;

    varAttribute.lVal = acBorderWidthDouble;

    oText->Attribute["BorderWidth"] = varAttribute;

    oText->Attribute["Text"] = "Amyuni Technologies";

 

    // Create a Barcode in the current Page

    m_PDF->CreateObject(acObjectTypeBarcode, "Barcode1");

    IacObjectPtr oBarcode = m_PDF->GetObjectByName("Barcode1");

    oBarcode->Attribute["Left"] = 100;

    oBarcode->Attribute["Right"] = 3100;

    oBarcode->Attribute["Top"] = 1000;

    oBarcode->Attribute["Bottom"] = 2100;

    varAttribute.lVal = 1;

    oBarcode->Attribute["BarcodeType"] = varAttribute;  // PDF417 barcodes are the only type supported

    oBarcode->Attribute["VerticalScale"] = 3.0;  // Amount by which to scale the barcode vertically, default

    oBarcode->Attribute["Text"] = "Copyright 2015 Amyuni Technologies";

 

    //  scroll the window by 1 inch both vertically

    //  and horizontally

    m_PDF->ScrollWindow(72, 72);

 

    // Save PDF

    m_PDF->Save("c:\\temp\\CreatePDFDocument_resulting.pdf", acFileSaveView);

 

    // destroy objects

    oText = NULL;

    oBarcode = NULL;

}