How to obtains a image from PDF file

55 pts.
Tags:
image
PDF
VS.NET
How to obtains a image from PDF file inn a Web Page working in Visual Studio .NET 2008 and the Adobe Acrobat 9.0 installed. We want in basis to a PDF file, obtain the .jpg, .png or .bmp bitmap for usage in a Web Page without use of Windows Forms. In the server side work. Tanks

Software/Hardware used:
VS .NET 2008 Windows 7

Answer Wiki

Thanks. We'll let you know when a new response is added.

I would use a screen capture program like SnagIt to “copy” the picture you want and then save it in the format you desire. PDFs are capable by security options to restrict what you can copy and even print from the document.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • 77258840
    We work with other image formats like .jpg or .png but with .pdf we can not obtain the image for work with him. Is not posible to use the other applications, we need work all in the behavior code of the page. Thanks but is not a solution.
    55 pointsBadges:
    report
  • 77258840
    The problem is in obtains a Image from PDF file. I working in Visual Studio .Net 2008 in a web form. The code is very simple: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim PathApp As String = "C:UsersUsuarioDocumentsVisual Studio 2008WebSitesMafWebArchivosAuxiliares" Dim filePath As String = PathApp & "IS2008.pdf" Dim fileSave As String = filePath.Replace(".pdf", ".png") Dim pdfDocument As New Acrobat.AcroPDDoc, pdfPage As Acrobat.AcroPDPage Dim pdfFile As System.IO.FileStream Dim newWidth As Integer, newHeight As Integer, numPages As Integer Dim pointPdfSize As Acrobat.AcroPoint, HDC As Integer, rectPdfSize As New Acrobat.AcroRect Booleano = pdfDocument.Open(filePath) numPages = pdfDocument.GetNumPages pdfPage = pdfDocument.AcquirePage(0) pdfFile = New System.IO.FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read) pointPdfSize = pdfPage.GetSize newWidth = CInt(pointPdfSize.x) newHeight = CInt(pointPdfSize.y) rectPdfSize.Top = 0 rectPdfSize.Left = 0 rectPdfSize.right = newWidth rectPdfSize.bottom = newHeight 'if I do: pdfPage.CopyToClipboard(rectPdfSize, 0, 0, 100) I am in clipboard the image and I can paste it in a word document or something similar but only when i run in a Local Server Dim newBitmap As Bitmap, newGraphic As Graphics, Objeto As Object newBitmap = New Bitmap(newWidth, newHeight) newGraphic = Graphics.FromImage(newBitmap) HERE IS THE PROBLEM: Dim nHDC As Integer = newGraphic.GetHdc() Dim nHWND As Integer = nHDC WHAT ARE THE CORRECTS nHWND and nHDC? The result of next sentence are allways: Arithmetic operation has resulted in an overflow. I PROUVE WITH ALL COMBINATIONS FOR nHWND and nHDC with IntPtr.Zero as GetDC for display… thousands runs any exit pdfPage.Draw(nHWND, nHDC, 0, 0, 100) ' but how obtains nHWND and nHDC?, where puts the image? 'pdfPage.DrawEx(nHWND, nHDC, rectPdfSize, 0, 0, 100) ' but how obtains nHWND and nHDC, where puts the image? newBitmap.Save(fileSave) Panel__Doc.BackImageUrl = fileSave End Sub I am the complete Adobe Acrobat 9.0 installed in my PC and into sample application I have: Imports System.Runtime.InteropServices Imports System.Windows Imports System.Drawing Imports System.Drawing.Imaging Imports System.Drawing.Drawing2D Imports System.Drawing.Design Imports Acrobat Imports AcroPDFLib Can you help me, please?
    55 pointsBadges:
    report
  • Cherrycat
    Maybe you can try this PDF to Image Converter, it can change pDF fiels to images. And I have used it, it was easy to use.
    20 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following