I am using the following code to generate a tiff from a PDF, taken directly from this site.
However the Tiff it generates only has the pdf page taking up about 1/4 of the generated tiff image. The image itself is the right size, but the tiff is only taking up about 1/4 of the page with the rest blank… I have tried playing around with the pagesize on the TIFFDEVICE constructor, but that seems to only affect the size of the overall tiff, it still shows the converted PDF as only 1/4 of the screen.
Is this a limitation of the evaluation package? or is there some setting somewhere so that it converts the PDF to a TIFF of equivalent size?
// Open document
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(“test.pdf”);
// Create stream object to save the output image
java.io.OutputStream imageStream = new java.io.FileOutputStream("output.tiff");
// Create Resolution object
Resolution resolution = new Resolution(300);
// instantiate TiffSettings object
TiffSettings tiffSettings = new TiffSettings();
// set the compression of resultant TIFF image
// set the color depth for resultant image
// skip blank pages while rendering PDF to TIFF
// Create TiffDevice object with particular resolution
TiffDevice tiffDevice = new TiffDevice(com.aspose.pdf.PageSize.getPageLetter(),resolution, tiffSettings);
// Convert a particular page (Page 1) and save the image to stream
tiffDevice.process( pdfDocument, imageStream);
// Close the stream