i would like to take print of a pdf i generated. the current problem in taking print is the print of whole pdf is coming. i need to take the print of pdf which i written
please help me friends
thanks
Know the answer? Post it. Somebody with the same question will find it here.
Naidu AMMAN33 pointsPosted Mar 3, 2015, 7:57 PM EST
Using stream As New FileStream(txtbrowse.Text, FileMode.Create) Dim pdfDoc As New Document(PageSize.A4, 20.0F, 20.0F, 20.0F, 20.0F) Dim iTextfont As New Font(iTextSharp.text.Font.FontFamily.TIMES_ROMAN, 10, 10) PdfWriter.GetInstance(pdfDoc, stream) pdfDoc.Open() pdfDoc.Add(pdfTable) pdfDoc.Close() stream.Close() End Using End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() End Sub Private Sub frmDetailreport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim m_passtypes As New frmDetailreport If DataGridView1.SelectedRows.Count > 0 Then m_passtypes.txtVehicleType.Text = DataGridView1.SelectedRows(0).Cells(0).Value.ToString() m_passtypes.txtVehiclecount.Text = DataGridView1.SelectedRows(0).Cells(1).Value.ToString() m_passtypes.txtamount.Text = DataGridView1.SelectedRows(0).Cells(2).Value.ToString() m_passtypes.txtextraamount.Text = DataGridView1.SelectedRows(0).Cells(3).Value.ToString() m_passtypes.txttotalamount.Text = DataGridView1.SelectedRows(0).Cells(4).Value.ToString() End If Dim m_db As New CDataAccess Dim m_ds As New DataSet, strqry As String = "" Dim i As Integer strqry = "SELECT DISTINCT DeviceID FROM tblcollection;" m_ds = m_db.getdata(strqry, strconnection) If Not m_ds Is Nothing Then If m_ds.Tables(0).Rows.Count > 0 Then For i = 0 To m_ds.Tables(0).Rows.Count - 1shiju kv72 pointsPosted Mar 3, 2015, 8:25 PM EST
Flora Tome2 pointsPosted Mar 5, 2015, 3:11 AM EST
I am not familiar with iTextSharp SDK, but I used leadtools for several years to load PDF files. If you mean that you want to save the PDF file after loading it, you can simply load the PDF file as raster image using one of leadtools .NET load functions, and then save it to any supported file format (like PNG, JPEG, GIF, etc.). I am currently using the following code to load and save PDF files to PNG format using leadtools:
+--------------+
using (RasterCodecs codecs = new RasterCodecs())
{
codecs.Options.RasterizeDocument.Load.XResolution = 300;
codecs.Options.RasterizeDocument.Load.YResolution = 300;
RasterImage image = codecs.Load(imageFileName, p);
codecs.Save(image, @"c:\Temp\Print.png", RasterImageFormat.Png, 24);
}
+--------------+
I hope this helps :)