locked
How to display all images in listbox control using MuPDFLib RRS feed

  • Question

  • I am reading a PDF file using MuPDFLib and I am extracting PDF files into images, How to display all images without storing on local disk, My code is give below.

                    int page =1;
                    int dpi = 200;
                    MuPDFLib.RenderType renderType = MuPDFLib.RenderType.RGB;
                    bool rotateAuto = true;
                    string password = "";
                    MuPDFLib.MuPDF pdfDoc = new MuPDFLib.MuPDF(yourPdfFilename, password);
                    pdfDoc.Page = page;
              for(int i=1;i<pdfDoc.PageCount;i++)
              {
                    Bitmap bm = pdfDoc.GetBitmap(0, 0, dpi, dpi, 0, renderType,
                                                 rotateAuto, false, 0);
                    MemoryStream ms = new MemoryStream();
                    System.Windows.Controls.Image image = new System.Windows.Controls.Image();
                    bm.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                    ms.Position = 0;
                    BitmapImage bi = new BitmapImage();
                    bi.BeginInit();
                    bi.StreamSource = ms;
                    bi.EndInit();
                    pdfDoc.Dispose();
                    
                    image.Source = bi;

                    ListboxControl1.Items.Add(image);

    }


    Musakkhir Sayyed.

    • Moved by Just Karl Monday, November 18, 2013 6:42 PM Looking for the proper forum.
    Monday, November 18, 2013 4:00 PM

Answers

  • You'd want to ask the MuPDF people

    http://www.mupdf.com/

    Looks like the "support" is offered in IRC.

    However, if you ewant to ask in Microsoft forums, and hope that someone else has used this, you can post in Visual C#

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer



    My Blog: http://unlockpowershell.wordpress.com
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})

    Monday, November 18, 2013 6:47 PM

All replies

  • Hello,

    This forum is for discussions and questions regarding profiles and Microsoft's recognition system on the MSDN and TechNet sites. It is not for products/technologies.

    As it's off-topic here, I am moving the question to the "Where is the forum for..." forum.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer



    My Blog: http://unlockpowershell.wordpress.com
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})

    Monday, November 18, 2013 6:42 PM
  • You'd want to ask the MuPDF people

    http://www.mupdf.com/

    Looks like the "support" is offered in IRC.

    However, if you ewant to ask in Microsoft forums, and hope that someone else has used this, you can post in Visual C#

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer



    My Blog: http://unlockpowershell.wordpress.com
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})

    Monday, November 18, 2013 6:47 PM