How do I write a simple console C# app using this class?
--------------------------------------------------------------------------------
This following console app attempts to use the PDFToImage class (at bottom of
this post):
Code:
class MainClass
{
[STAThread]
public static void Main(string[] args)
{
if (args.Length < 6)
{
Console.WriteLine("Usage: PDF2JPEG <-password> <-startPage>
<-endPage> <-imageType> <-outputPrefix> <PDF file>");
return;
}
using (StreamWriter sw = new StreamWriter(args[5]))
{
sw.WriteLine(transformPDFToImage(args[0]));
}
}
private static string transformPDFToImage(string input)
{
whatdoiwritehere?PDFToImage(input);...?
}
}
I've tried...
Code:
PDFToImage pdf2i = new PDFToImage(input);
...but the compiler responds with The type 'org.pdfbox.PDFToImage' has no
constructors defined(CS0143)
If I write...
Code:
PDFToImage pdf2i = new PDFToImage();
...the compiler responds with 'pdf2i' is a 'variable' but is used like a
'method'(CS0118)
Thanks for any help.
For reference, here's the PDFToImage class definition (written in Java). (In my
library, it's since been dotnetized, using IKVM, into a .NET-referenceable
DLL):
http://svn.apache.org/repos/asf/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/PDFToImage.java