Aspose.Pdf Converting a Tiff to PDF

Last post 02-12-2009, 8:38 PM by codewarior. 1 replies.
Sort Posts: Previous Next
  •  02-12-2009, 6:01 PM 165007

    Aspose.Pdf Converting a Tiff to PDF

    We purchased Aspose.Total for .NET yesterday. I'm using Aspose.Pdf to convert a tiff file to a pdf. The conversion seems to go OK and there are no exceptions but the tiff image which is 8.5 X 11 creates a PDF page that is about 8.5 X 11.75. The additional height is causing problems with stamping using Aspose.Pdf.Kit.

    Is there a property that I can set to avoid the additional height?


    This message was posted using Page2Forum from Aspose products - Documentation
     
  •  02-12-2009, 8:38 PM 165022 in reply to 165007

    Re: Aspose.Pdf Converting a Tiff to PDF

    Hi,

    Thanks for your interest in Aspose.

    You can use PageInfo property of Section class to specify the PageHeight and PageWidth. Please try using the following code snippet.

    [C#]

    //Instantiate a Pdf object by calling its empty constructor
    Pdf pdf1 = new Pdf
    ();

    //Create a section in the Pdf object
    Aspose.Pdf.Section
    sec1 = pdf1.Sections.Add();
    //Create an image object in the section
    Aspose.Pdf.Image image1 = new Aspose.Pdf.Image
    (sec1);
    //Add image object into the Paragraphs collection of the section
    sec1.Paragraphs.Add(image1);
    //Set the path of image file
    image1.ImageInfo.File = "d:/pdftest/calendar_transparent_300dpi.tif"
    ;
    //Set the type of image using ImageFileType enumeration
    image1.ImageInfo.ImageFileType = ImageFileType
    .Tiff;

    pdf1.Sections[0].PageInfo.PageHeight = 846; // where 1 inch = 72 Points. 11.75*72=846
    pdf1.Sections[0].PageInfo.PageHeight = 576;

    //Save the Pdf
    pdf1.Save("d:\\pdftest\\tiffsize_issue3.pdf");

    For more related information please visit Set Page Size and Margins.

    In case of any further query, please feel free to share.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML