How to Split a PDF File Into Multiple Files?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I just stumbled across this link:

http://miracle00.weebly.com/3/post/2012/4/cvbnet-split-one-pdf-document-to-multiple-files.html http://miracle00.weebly.com/3/post/2012/4/cvbnet-split-one-pdf-document-to-multiple-files.html

I already have Spire.DataExport installed in my VS 2010. I popped the code form that link into a project that Im working on, but it didnt work at all. Here is my code:
using System;<br/>
using System.Collections.Generic;<br/>
using System.ComponentModel;<br/>
using System.Data;<br/>
using System.Drawing;<br/>
using System.Linq;<br/>
using System.Text;<br/>
using System.Windows.Forms;<br/>
<br/>
namespace WindowsFormsApplication3<br/>
{<br/>
public partial class Form1 : Form<br/>
{<br/>
public Form1()<br/>
{<br/>
InitializeComponent();<br/>
}<br/>
<br/>
private void button1_Click(object sender, EventArgs e)<br/>
{<br/>
//open pdf document<br/>
PdfDocument doc = new PdfDocument(@"C:\Users\Excel\Desktop\Excel_Files\Sample3.pdf");<br/>
//Split the PDF Document<br/>
String pattern = "SplitDocument-{0}.pdf"; doc.Split(pattern);<br/>
String lastPageFileName = String.Format(pattern, doc.Pages.Count - 1);<br/>
doc.Close();<br/>
//Launching the Pdf file.<br/>
System.Diagnostics.Process.Start(lastPageFileName);<br/>
}<br/>
}<br/>
}<br/>
<br/>

These are the errors that Im getting:
The type or namespace name PdfDocument could not be found (are you missing a using directive or an assembly reference?)

I dont see any Reference to Spire, anywhere. I certainly dont see anything under Project > Add Reference. Any ideas anyone??? <hr class="sig Ryan Shuell

View the full article
 
Back
Top