Click here to Skip to main content
15,913,941 members
Home / Discussions / C#
   

C#

 
QuestionSmall XML problem Pin
Martin235-Jan-06 4:37
Martin235-Jan-06 4:37 
AnswerRe: Small XML problem Pin
Guffa5-Jan-06 5:34
Guffa5-Jan-06 5:34 
GeneralRe: Small XML problem Pin
Martin235-Jan-06 6:06
Martin235-Jan-06 6:06 
AnswerRe: Small XML problem Pin
Guffa5-Jan-06 7:19
Guffa5-Jan-06 7:19 
GeneralRe: Small XML problem Pin
Martin235-Jan-06 9:11
Martin235-Jan-06 9:11 
AnswerRe: Small XML problem Pin
Guffa9-Jan-06 1:48
Guffa9-Jan-06 1:48 
AnswerRe: Small XML problem Pin
leppie5-Jan-06 11:37
leppie5-Jan-06 11:37 
QuestionConverting PDF to Text in C# Pin
curtKauf5-Jan-06 4:34
curtKauf5-Jan-06 4:34 
I am having trouble using the code from the tutorial posted here. The following is all of my code. I have commented what the original download version had in it...

using System;
using System.IO;
using org.pdfbox.pdmodel;
using org.pdfbox.util;

namespace Pdf2Text
{
class Program

{

///
/// The main entry point for the application.
///

[STAThread]
static void Main(string[] args)
{
DateTime start = DateTime.Now;
if (args.Length < 2)

{
//The following line is the way it is written in the downloaded version
//Console.WriteLine("Usage: PDF2TEXT ");
//I wrote this
Console.WriteLine("Usage: PDF2TEXT MyPDF.pdf MYTEXT.txt");

//return;
}

using (StreamWriter sw = new StreamWriter(args[1]))
{
sw.WriteLine(parseUsingPDFBox(args[0]));
}

Console.WriteLine("Done. Took " + (DateTime.Now - start));
Console.ReadLine();

}

private static string parseUsingPDFBox(string input)
{
PDDocument doc = PDDocument.load(input);
PDFTextStripper stripper = new PDFTextStripper();
return stripper.getText(doc);
}
}
}



I get the following error message when I try to run it:

"An unhandled exception of type 'System.IndexOutOfRangeException' occurred in Pdf2Text.exe
Additional information: Index was outside the bounds of the array."

Can someone help!




Curt
AnswerRe: Converting PDF to Text in C# Pin
Stanciu Vlad5-Jan-06 7:14
Stanciu Vlad5-Jan-06 7:14 
GeneralRe: Converting PDF to Text in C# Pin
curtKauf5-Jan-06 8:51
curtKauf5-Jan-06 8:51 
GeneralRe: Converting PDF to Text in C# Pin
Stanciu Vlad5-Jan-06 20:53
Stanciu Vlad5-Jan-06 20:53 
QuestionQueued Timers Pin
LiamD5-Jan-06 3:48
LiamD5-Jan-06 3:48 
AnswerRe: Queued Timers Pin
Guffa5-Jan-06 4:16
Guffa5-Jan-06 4:16 
GeneralRe: Queued Timers Pin
Dave Kreskowiak5-Jan-06 4:34
mveDave Kreskowiak5-Jan-06 4:34 
GeneralRe: Queued Timers Pin
LiamD5-Jan-06 21:57
LiamD5-Jan-06 21:57 
GeneralRe: Queued Timers Pin
Dave Kreskowiak6-Jan-06 2:54
mveDave Kreskowiak6-Jan-06 2:54 
GeneralRe: Queued Timers Pin
LiamD8-Jan-06 22:22
LiamD8-Jan-06 22:22 
GeneralRe: Queued Timers Pin
Dave Kreskowiak9-Jan-06 2:06
mveDave Kreskowiak9-Jan-06 2:06 
QuestionReflecting inherited interfaces Pin
Hans Ruck5-Jan-06 3:38
Hans Ruck5-Jan-06 3:38 
AnswerRe: Reflecting inherited interfaces Pin
leppie5-Jan-06 5:40
leppie5-Jan-06 5:40 
QuestionHelp Needed in C# Chess Game development Pin
usmanali1235-Jan-06 3:28
usmanali1235-Jan-06 3:28 
AnswerRe: Help Needed in C# Chess Game development Pin
Guffa5-Jan-06 3:33
Guffa5-Jan-06 3:33 
GeneralRe: Help Needed in C# Chess Game development Pin
usmanali1235-Jan-06 3:45
usmanali1235-Jan-06 3:45 
GeneralRe: Help Needed in C# Chess Game development Pin
Guffa5-Jan-06 4:19
Guffa5-Jan-06 4:19 
AnswerRe: Help Needed in C# Chess Game development Pin
albCode5-Jan-06 3:50
albCode5-Jan-06 3:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.