Hi all,
Can anybody tell me if there is any source code available for bmp to pdf conversion in C,C++ or VC++ language? I need one that will work on Windows XP.
Even snipets will do, I will then try to build on that. In short I just need something to get started with.
Regards
Comments
:
: Can anybody tell me if there is any source code available for bmp to pdf conversion in C,C++ or VC++ language? I need one that will work on Windows XP.
: Even snipets will do, I will then try to build on that. In short I just need something to get started with.
:
: Regards
:
Any idea how complex a pdf is? There is a 500 lines long document decribing the format of it at this link:
http://www.wotsit.org/
I doubt if there is any open source, Adobe probably owns the rights to the format, in some way. Maybe there are commercial plugins or such... you could always get Acrobat PDFWriter and call it as if it was a printer.
public static string FolderName = "c:/";
private void button1_Click(object sender, EventArgs e)
{
string fileName = FolderName + "Sample.pdf";
REDocument doc = REFile.OpenDocumentFile(fileName, new PDFDecoder());//use PDFDecoder open a pdf file
REDocument doc1 = REFile.OpenDocumentFile(fileName, new PDFDecoder());//use PDFDecoder open a pdf file
int pageCount = doc.GetPageCount();//get pdf's page count
for (int pgIdx = 0; pgIdx < pageCount; pgIdx++)
{
BasePage aPage = doc.GetPage(pgIdx);//get page from REDocument
try
{
REImage img = (REImage)aPage.ToImage();//translate page to image
REFile.SaveImageFile(img, FolderName + "output" + pgIdx + ".bmp");//save image
}
catch (Exception)
{
Debug.WriteLine("Fail to display page " + pgIdx);
}
Debug.Write(DateTime.Now.ToString("HH-mm-ss") + "
");
}
int pageCount1 = doc1.GetPageCount();
Debug.WriteLine(pageCount1);
}
You can google it and select a PDF converting SDK whose way of processing is simple and fast to help you with the related work. Remember to check its free trial package first if possible. I hope you success. Good luck.
Best regards,
Arron