Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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();

}
}



}
}
Posted
Updated 20-Jun-15 1:41am
v2
Comments
Sergey Alexandrovich Kryukov 18-Jun-15 16:08pm    
What is that supposed to mean? If you mean multi-page TIFF, what do you want to do with the pages?
—SA

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900