Rasterizer.ColorSpace = PdfRasterizerColorSpace.RGB StartPage = Convert.ToInt32(TxtStartPage.Text)Ĭatch End Try Dim endPage As Integer = 0 TryĮndPage = Convert.ToInt32(TxtEndPage.Text)Ĭatch End Try ' instantiate a pdf rasterizer (pdf to image converter) object Dim rasterizer As New PdfRasterizer() ' settings Dim imgFormat As String = DdlImageFormat.SelectedValue ' the test file Dim filePdf As String = Server.MapPath( "~/files/selectpdf.pdf") Protected Sub BtnSubmit_Click(sender As Object, e As EventArgs) Using ( var ms = new System.IO.MemoryStream()) "attachment filename=\"" + fileName + "\"") Response.AppendHeader( "content-disposition", Response.AddHeader( "Content-Length", ()) Response.AddHeader( "Content-Type", httpHeader) ImgBytes = GetImageBytes(images, format) format įormat = .Png įormat = .Jpeg įormat = .Bmp the other image formats (PNG, JPG, BMP) convert pages to images byte imgBytes PdfRasterizer rasterizer = new PdfRasterizer() instantiate a pdf rasterizer (pdf to image converter) object StartPage = Convert.ToInt32(TxtStartPage.Text) ĮndPage = Convert.ToInt32(TxtEndPage.Text) settings string imgFormat = DdlImageFormat.SelectedValue the test file string filePdf = Server.MapPath( "~/files/selectpdf.pdf") Protected void BtnSubmit_Click( object sender, EventArgs e) Public partial class pdf_to_image_converter : .Page ImagesPrefix - The prefix for the generated images file name. ImagesPath - The path to the disk folder where the images will be saved. ImagesFormat - The image format for the generated images. Some additional properties can be set if the images are saved directly into files on disk Resolution - The resolution of the generated images in DPI. The default value is null, which means that no password will be used to open the PDF document.ĬolorSpace - The color space of the generated images. UserPassword - The user password to be used to open the PDF document for reading. The default value is 0 which means that all the PDF document is processed starting from the StartPageNumber page. The default value is 1 which means that the operation will start from the first page.ĮndPageNumber - The page number where the current operation will end on the PDF file. StartPageNumber - The page number from where the current operation will start on the PDF file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |