If someone else is wondering here is the code that I have. I have attached a picture of the app also.
CODE
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;
using System.IO;
using WebSupergoo.ABCpdf7;
using WebSupergoo.ABCpdf7.Objects;
using WebSupergoo.ABCpdf7.Atoms;
using WebSupergoo.ABCpdf7.Operations;
namespace CSBconvert
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void exitApplication(Object sender, EventArgs e)
{
Application.Exit();
}
private void btnPDFLoc_Click(object sender, EventArgs e)
{
if (openFD.ShowDialog() == DialogResult.OK)
{
txtPDFLoc.Text = openFD.SelectedPath.ToString();
}
}
private void btnOutput_Click(object sender, EventArgs e)
{
if (openFD.ShowDialog() == DialogResult.OK)
{
txtOutput.Text = openFD.SelectedPath.ToString();
}
}
private void btnProcess_Click(object sender, EventArgs e)
{
string filePath = txtPDFLoc.Text + "\\";
string savePath = txtOutput.Text;
string fileName;
DirectoryInfo directoryList = new DirectoryInfo(@filePath);
FileInfo[] pdfFile = directoryList.GetFiles("*.pdf");
foreach (FileInfo file in pdfFile)
{
Doc theDoc = new Doc();
theDoc.Read(filePath + file.Name);
// set up the rendering parameters
theDoc.Rendering.ColorSpace = "Gray";
theDoc.Rendering.BitsPerChannel = 1;
theDoc.Rendering.DotsPerInchX = 200;
theDoc.Rendering.DotsPerInchY = 400;
// loop through the pages
int n = theDoc.PageCount;
fileName = Path.GetFileNameWithoutExtension(file.FullName);
for (int i = 1; i <= n; i++)
{
theDoc.PageNumber = i;
theDoc.Rect.String = theDoc.CropBox.String;
theDoc.Rendering.SaveAppend = (i != 1);
//theDoc.Rendering.SaveCompression = XRendering.Compression.G4;
theDoc.SetInfo(0, "ImageCompression", "4");
theDoc.Rendering.Save(savePath + "\\" + fileName + ".tiff");
}
theDoc.Clear();
}
}
}
}
Hope this helps someone else. Now I just need to figure out how I can add a progress bar.