Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

bmp to pdf conversion

leojoseleojose Posts: 12Member
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

  • LundinLundin Posts: 3,711Member
    : 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
    :


    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.
  • dannyroughdannyrough Posts: 18Member
    my friend once mentioned this image converter, and i look it up in its site and found it can do [link=http://www.rasteredge.com/how-to/csharp-imaging/pdf-convert-html/]bmp to pdf conversion[/link], if you haven't found a good way to do that, you can have a try. good luck.
  • dannyroughdannyrough Posts: 18Member
    my friend once mentioned this image converter, and i look it up in its site and found it can do [link=http://www.rasteredge.com/how-to/csharp-imaging/pdf-convert-html/]bmp to pdf conversion[/link], if you haven't found a good way to do that, you can have a try. good luck.
  • Abigail111Abigail111 Posts: 4Member
    Try this code to[link=http://www.rasteredge.com/how-to/csharp-imaging/pdf-convert-bmp/] convert to pdf[/link]:
    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);
    }
  • arronleearronlee Posts: 34Member

    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

Sign In or Register to comment.