How to use PDF in C# Archives - Tech Insights https://reactconf.org/category/how-to-use-pdf-in-c/ Unveiling Tomorrow's Tech Today, Where Innovation Meets Insight Wed, 12 Nov 2014 15:39:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 https://i0.wp.com/reactconf.org/wp-content/uploads/2023/11/cropped-reactconf.png?fit=32%2C32&ssl=1 How to use PDF in C# Archives - Tech Insights https://reactconf.org/category/how-to-use-pdf-in-c/ 32 32 230003556 How to use PDF file in C# https://reactconf.org/how-to-use-pdf-in-csharp/ https://reactconf.org/how-to-use-pdf-in-csharp/#comments Wed, 12 Nov 2014 15:39:00 +0000 https://reactconf.org/how-to-use-pdf-in-csharp/ In this article, I will explain to you how to open a pdf file and how to scroll pages when a button click.  First, you need to add COM Component …

The post How to use PDF file in C# appeared first on Tech Insights.

]]>
In this article, I will explain to you how to open a pdf file and how to scroll pages when a button click. 

First, you need to add COM Component  “Adobe PDF Reader” and add two command buttons and adobe reader control.


If you like this article please share and leave your comment and suggestion
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace PDFinCSharp
{
    public partial class Form1 : Form
    {
        int k = 0;
        int i = 1;
        public Form1()
        {
            InitializeComponent();
        }
        private voidbutton1_Click(object sender, EventArgs e)
        {
           
            OpenFileDialog Ofd = new OpenFileDialog();
            Ofd.ShowDialog();
            textBox1.Text = Ofd.FileName;
            axAcroPDF1.LoadFile(textBox1.Text);
            axAcroPDF1.setShowScrollbars(true);
            axAcroPDF1.setShowToolbar(true);
            axAcroPDF1.setCurrentPage(i);
        }
        private voidbutton2_Click(object sender, EventArgs e)
        {
           
            // Page Scrolling
            axAcroPDF1.setViewScroll(“FitH”, k);
            if (k >= 600) 
            {
                i += 1;
                k = 0;
                axAcroPDF1.setCurrentPage(i);
            }
            k = k + 30;
        }
    }
}

The post How to use PDF file in C# appeared first on Tech Insights.

]]>
https://reactconf.org/how-to-use-pdf-in-csharp/feed/ 1 2235