如何生成图像格式的报告............. [英] How to generate reports in image format.............

查看:96
本文介绍了如何生成图像格式的报告.............的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用c#处理.net中的Windows应用程序,我希望以图像格式生成报告,如何生成图像格式的报告或如何将PDF转换为图像格式.... plz帮助我..

解决方案

要将PDF文件转换为PNG格式的图像,请使用lib-pdf

您可以在这里下载库lib-pdf



将pdf转换为图像的代码很简单,

请找到复制代码:



使用(FileStream file = File.OpenRead(@.. \ path\to\pdf\file.pdf))//在文件
{
var bytes = new byte [file.Length];
file.Read(bytes,0,bytes.Length);
using(var pdf = new LibPdf(bytes))
{
byte [] pngBytes = pdf.GetImage(0,ImageType.PNG); //图像类型
using(var outFile = File.Create(@.. \ path \ toto \ pdf \ file.png))// out file
{
outFile.Write(pngBytes,0,pngBytes.Length);
}
}
}





在我提供的链接中,您将获得lib-pdf网站主页。



1.转到顶部的下载标签

2.下载x86发布二进制文件(你的项目也必须是x86) )



你会在那里找到dll文件。



或者使用这个直接链接。 https://code.google。 com / p / lib-pdf / downloads / detail?name = binaries.zip& can = 2& q = [^] [ ^ ]


< blockquote>在我提供的链接中,您将到达lib-pdf网站主页。



1.转到顶部的下载标签

2.下载x86发布二进制文件(你的项目也必须是x86)



你会在那里找到dll文件。



或使用此直接链接。 https://code.google.com/p /lib-pdf/downloads/detail?name=binaries.zip&can=2&q= [ ^ ]


I m working on a windows application in .net with c#, i want to generate reports in image format,how i generate reports in image format or how to convert PDFs into image format....plz help me..

解决方案

To convert PDF file to image in PNG format, Please use lib-pdf
You can download the library here lib-pdf

The code to convert pdf to image is simple,
Please find copied the code :

using (FileStream file = File.OpenRead(@"..\path\to\pdf\file.pdf")) // in file
{
    var bytes = new byte[file.Length];
    file.Read(bytes, 0, bytes.Length);
    using (var pdf = new LibPdf(bytes))
    {
        byte[] pngBytes = pdf.GetImage(0,ImageType.PNG); // image type
        using (var outFile = File.Create(@"..\path\to\pdf\file.png")) // out file
        {
            outFile.Write(pngBytes, 0, pngBytes.Length);
        }
    }
}



In the link i provided, you will reach lib-pdf site home page.

1. Goto downloads tab at the top
2. Download the x86 release binaries (your project must be x86 too)

You will find the dll files there.

Or use this direct link. https://code.google.com/p/lib-pdf/downloads/detail?name=binaries.zip&can=2&q=[^][^]


In the link i provided, you will reach lib-pdf site home page.

1. Goto downloads tab at the top
2. Download the x86 release binaries (your project must be x86 too)

You will find the dll files there.

Or use this direct link. https://code.google.com/p/lib-pdf/downloads/detail?name=binaries.zip&can=2&q=[^]


这篇关于如何生成图像格式的报告.............的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆