小编use*_*592的帖子

使用iTextSharp将某些TIF压缩格式转换为PDF时出现问题

我正在使用iTextSharp将单页TIF文件转换和拼接为多页PDF文件。单页TIF文件具有不同的位深和压缩率。

这是代码-

private void button1_Click(object sender, EventArgs e)
{
    List<string> TIFfiles = new List<string>();
    Document document;
    PdfWriter pdfwriter;
    Bitmap tifFile;
    pdfFilename = <file path>.PDF;
    TIFfiles = <load the path to each TIF file in this array>;

    //Create document 
    document = new Document();

    // creation of the different writers
    pdfwriter = PdfWriter.GetInstance(document, new System.IO.FileStream(pdfFilename, FileMode.Create));

    document.Open();
    document.SetMargins(0, 0, 0, 0);

    foreach (string file in TIFfiles)
    {

        //load the tiff image  
        tifFile = new Bitmap(file);

        //Total number of pages

        iTextSharp.text.Rectangle pgSize = …
Run Code Online (Sandbox Code Playgroud)

itext itextsharp

2
推荐指数
1
解决办法
1921
查看次数

标签 统计

itext ×1

itextsharp ×1