在这个程序中,我只能将单个图片(或)Tiff转换为Pdf。如何将多Tiff文件转换为单个Pdf文件..帮助我...... [英] In This Program I Can Only Able To Convert Single Picture(Or) Tiff To Pdf. How Can I Convert Multi Tiff File To Single Pdf File..Help Me...
问题描述
使用System;
使用System.Collections.Generic;
使用System.ComponentModel;
使用System.Data;
使用System.Drawing;
使用System.Linq;
使用System.Text;
使用System.Windows.Forms ;
使用Microsoft.SqlServer;
使用System.IO;
使用iTextSharp.text;
使用iTextSharp .text.pdf;
使用System.Drawing.Imaging;
使用iTextSharp.text;
使用iTextSharp.text.pdf;
使用System;
使用System.Collections.Generic;
使用System.Text;
使用System.Drawing。打印;
使用System.Diagnostics;
命名空间Image_to_Pdf
{
公共部分课程表格1:表格
{
public Form1()
{
InitializeComponent();
OpenFileDialog ofd = new OpenFileDialog();
}
private string [] fileName;
private void button1_Click(object sender,System.EventArgs e)
{
// PrintDialog printDlg = new PrintDialog();
// PrintDocument printDoc = new PrintDocument();
//printDoc.DocumentName =打印文档;
//printDlg.Document = printDoc;
//printDlg.AllowSelection = true;
//printDlg.AllowSomePages = true;
////调用ShowDialog
// if(printDlg.ShowDialog()== DialogResult.OK)
// printDoc.Print();
OpenFileDialog ofd = new OpenFileDialog();
ofd.Multiselect = true;
ofd.FilterIndex = 10;
if(ofd.ShowDialog()== D ialogResult.OK)
{
// string sFileName = ofd.FileName;
// string [] arrAllFiles = ofd.FileNames; //当Multiselect = true时使用
// TextBox tb = new TextBox();
//tb.Text = Path.GetFullPath ();
fileName = ofd.FileNames; //传入或者你需要的任何东西
var p = new Process();
p。 StartInfo.FileName + = fileName [0];
p.StartInfo.Verb =打印;
p.Start();
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.SqlServer;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
using System.Drawing.Imaging;
using iTextSharp.text;
using iTextSharp.text.pdf;
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Printing;
using System.Diagnostics;
namespace Image_to_Pdf
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
OpenFileDialog ofd = new OpenFileDialog();
}
private string[] fileName;
private void button1_Click(object sender, System.EventArgs e)
{
//PrintDialog printDlg = new PrintDialog();
//PrintDocument printDoc = new PrintDocument();
//printDoc.DocumentName = "Print Document";
//printDlg.Document = printDoc;
//printDlg.AllowSelection = true;
//printDlg.AllowSomePages = true;
////Call ShowDialog
//if (printDlg.ShowDialog() == DialogResult.OK)
// printDoc.Print();
OpenFileDialog ofd = new OpenFileDialog();
ofd.Multiselect = true;
ofd.FilterIndex = 10;
if (ofd.ShowDialog() == DialogResult.OK)
{
//string sFileName = ofd.FileName;
// string[] arrAllFiles = ofd.FileNames; //used when Multiselect = true
//TextBox tb = new TextBox();
//tb.Text = Path.GetFullPath();
fileName = ofd.FileNames; //pass in or whatever you need
var p = new Process();
p.StartInfo.FileName += fileName[0];
p.StartInfo.Verb = "Print";
p.Start();
}
}
}
}
推荐答案
这些文章建议如何使用多页TIFF的页面:
http://www.aspose.com/docs/display/imagingnet/Export+Multi-page+TIFF+frames+to+different+Image+format [ ^ ],
多页TIF查看器 [ ^ ],
将图像保存到多页TIFF文件或添加图像到现有的TIFF文件 [ ^ ]。
但是你不需要保存图像,你需要把他们用PDF。例如,您可以使用iText的.NET端口iTextSharp: http://sourceforge.net/projects/itextsharp [ ^ ]。
-SA
These articles suggest how to work with the pages of a multi-page TIFF:
http://www.aspose.com/docs/display/imagingnet/Export+Multi-page+TIFF+frames+to+different+Image+format[^],
Multipage TIF Viewer[^],
Save images into a multi-page TIFF file or add images to an existing TIFF file[^].
But you don't need to save images, you need to put them in PDF. You can use, for example, iTextSharp, a .NET port of iText: http://sourceforge.net/projects/itextsharp[^].
—SA
这篇关于在这个程序中,我只能将单个图片(或)Tiff转换为Pdf。如何将多Tiff文件转换为单个Pdf文件..帮助我......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!