Converting a pdf document to a jpeg image C#

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default Converting a pdf document to a jpeg image C#

    HI There,

    How can I convert a pdf document to a jpeg image using c sharp? I need to do this on a web application. If someone can help me out with some code that would be great.

    Sean - thanks in advance
    theonlysean@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Access Image Metadata in a jpeg?
      An image, like a jpeg, has a bunch of metadata stored in it. The "IPTC Core" metadata usually includes the photographers name, address, title,...
    2. Converting RGB image to CMYK causes image to disappear in Acro7
      Got a document that has placed images in it that are black and white but were placed as RGB, so I am getting scum dots where white should be upon...
    3. send a jpeg image to asp/php
      I need to send a custom jpeg edited in a shockwave editor to an asp/php page to save it on server. Anyone knows how to do?
    4. how to get the size of a jpeg image ?
      How can I get the height and width of a jpeg image ? Thank you for help me. Emmanuel
    5. converting gif to jpeg
      Hello, I am wondering if it is possible and legal to convert gif to jpeg with php. This would be helpful for clients to upload their logo, since...
  3. #2

    Default Re: Converting a pdf document to a jpeg image C#

    Before you can start the code, you need a suitable product installed.
    This may be more challenging than you realise.

    You cannot use Acrobat for this, because Acrobat must not be installed
    on a server. Adobe's PDF Library might work, but that has a C/C++
    linkage. Adobe's LiveCycle products seem to be Java based; not sure if
    one of them does this.

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  4. #3

    Default Re: Converting a pdf document to a jpeg image C#

    On Apr 2, 4:40*am, theonlys...@adobeforums.com wrote:
    try this from codeproject
    pdfDoc = (Acrobat.CAcroPDDoc)
    Microsoft.VisualBasic.Interaction.CreateObject("Ac roExch.PDDoc", "");
    int ret = pdfDoc.Open(inputFile);
    if (ret == 0)
    {
    throw new FileNotFoundException();
    }
    // Get the number of pages (to be used later if you wanted to store
    that information)
    int pageCount = pdfDoc.GetNumPages();
    // Get the first page
    pdfPage = (Acrobat.CAcroPDPage)pdfDoc.AcquirePage(0);
    pdfPoint = (Acrobat.CAcroPoint)pdfPage.GetSize();
    pdfRect = (Acrobat.CAcroRect)
    Microsoft.VisualBasic.Interaction.CreateObject("Ac roExch.Rect", "");
    pdfRect.Left = 0;
    pdfRect.right = pdfPoint.x;
    pdfRect.Top = 0;
    pdfRect.bottom = pdfPoint.y;
    // Render to clipboard, scaled by 100 percent (ie. original size)
    // Even though we want a smaller image, better for us
    to scale in .NET
    // than Acrobat as it would greek out small text
    // see [url]http://www.adobe.com/support/techdocs/1dd72.htm[/url]
    pdfPage.CopyToClipboard(pdfRect, 0, 0, 100);
    IDataObject clipboardData = Clipboard.GetDataObject();
    if (clipboardData.GetDataPresent(DataFormats.Bitmap))
    {
    Bitmap pdfBitmap =
    (Bitmap)clipboardData.GetData(DataFormats.Bitmap);
    }

    success Wim
    wim.van.boven@hotmail.com Guest

  5. #4

    Default Re: Converting a pdf document to a jpeg image C#

    Quote Originally Posted by theonlysean@adobeforums.com View Post
    HI There,

    How can I convert a pdf document to a jpeg image using c sharp? I need to do this on a web application. If someone can help me out with some code that would be great.

    Sean - thanks in advance
    You can use this solution!
    http://www.sautinsoft.com/products/pdf-focus/index.php

    SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
    f.ConvertPdfToImage(@"c:\sample.pdf", @"c:\pages\",
    SautinSoft.PdfFocus.eImageFormat.Jpeg, 200);
    Unregistered Guest

  6. #5

    Default Re: Converting a pdf document to a jpeg image C#

    You may want to check:

    Is opensource and use ghostscript (free download)

    example of use:

    converter = new PDFConverter();
    converter.JPEGQuality = 90;
    converter.OutputFormat = "jpg";
    converter.Convert("input.pdf", "output.jpg");
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139