vc++6.0 制作绿色pdf阅读程序
来源:百度知道 编辑:UC知道 时间:2024/05/18 01:39:17
并不需要给出源代码,只要能够按要求定制即可,还有一些文件操作的细节,所以不能用国外的免费阅读器。比如去掉另存打印等功能。
如果能提供相应的开发控件(ocx或dll)也可以。
希望以下程序能够帮助你
//write by wenhui.org
using System;
using System.IO;
using System.Text;
using System.Collections;
namespace PDFGenerator
{
public class PDFGenerator
{
static float pageWidth = 594.0f;
static float pageDepth = 828.0f;
static float pageMargin = 30.0f;
static float fontSize = 20.0f;
static float leadSize = 10.0f;
static StreamWriter pPDF=new StreamWriter("E:\\myPDF.pdf");
static MemoryStream mPDF= new MemoryStream();
static void ConvertToByteAndAddtoStream(string strMsg)
{
Byte[] buffer=null;
buffer=ASCIIEncoding.ASCII.GetBytes(strMsg);
mPDF.Write(buffer,0,buffer.Length);
buffer=null;
}