pdf转图片问题

发布于 2024-12-11 23:42:24 字数 443 浏览 0 评论 0原文

我正在尝试使用以下链接将 pdf 转换为图像 http://thirdbit.net/mail-archive/itext-questions/msg00436.html

但我收到此错误如何让此代码工作? “找不到类型或命名空间名称‘PdfDecoder’” 我正在寻找开源。

这个 Ghostscript 在服务器上不起作用, http://www.codeproject.com/KB/webforms/aspnetpdfviewer.aspx

帮我。

am trying to convert pdftoimage using the below link
http://threebit.net/mail-archive/itext-questions/msg00436.html

but i get this error how to get this code to work ?
"The type or namespace name 'PdfDecoder' could not be found"
am looking for open source .

this ghostscript dint work on server ,
http://www.codeproject.com/KB/webforms/aspnetpdfviewer.aspx

help me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我只土不豪 2024-12-18 23:42:24

你可以试试这个......

 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
 pdfPage.CopyToClipboard(pdfRect, 0, 0, 100);
IDataObject clipboardData = Clipboard.GetDataObject();
if (clipboardData.GetDataPresent(DataFormats.Bitmap))
{
  Bitmap pdfBitmap =
  (Bitmap)clipboardData.GetData(DataFormats.Bitmap);
}

请看一下这个链接更多信息

您也可以尝试这个,

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

请通过此链接获取更多信息< /a>

you Can try this.....

 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
 pdfPage.CopyToClipboard(pdfRect, 0, 0, 100);
IDataObject clipboardData = Clipboard.GetDataObject();
if (clipboardData.GetDataPresent(DataFormats.Bitmap))
{
  Bitmap pdfBitmap =
  (Bitmap)clipboardData.GetData(DataFormats.Bitmap);
}

pls take a look at this link For more info

you can try this one also

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

pls go through this link for more info

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文