Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

multipage tiff to pdf.

$
0
0

Hi,

i was trying to convert a multipage tiff image to pdf. But i see only the first page being added to pdf but not the rest of the tiff pages though i set "setIsAllFramesInNewPage" to true.

Can you please let me know how can i fix that.

Here is my code snippet.

 

//Instantiate a Pdf object by calling its empty constructor

Pdf pdf1 =

new Pdf();

//Create a section in the Pdf object

Section sec1 = pdf1.getSections().add();

//Create an image object in the section

aspose.pdf.Image img1 =

new aspose.pdf.Image();

//Add image object into the Paragraphs collection of the section

sec1.getParagraphs().add(img1);

// Specify the Image file type as TIFF

img1.getImageInfo().setImageFileType(ImageFileType.

Tiff);

img1.getImageInfo().setIsAllFramesInNewPage(

true);

// use the following method for performance improvement

img1.getImageInfo().setIsBlackWhite(

true);

// Specify the Image file path.

img1.getImageInfo().setFile(

"Test_TIFF1.tiff");

//Set desired image scale

img1.setImageWidthScale(1.25F);

//Save the document

pdf1.save(

"Tiff2PDF_Picture2.pdf");

 


Viewing all articles
Browse latest Browse all 3131

Trending Articles