We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unsupported bits per sample 4-4-4 count

Hi

We are experiencing new issues everyday, Does this software does not support every thing.

We are getting this error while merging the tiff files with a pdf to tiff converted tiff file.

Thanks
Amit

Hi Amit,


We are sorry for the inconvenience caused to you.

I am afraid, it is hard to say what could have gone wrong to cause the said error unless you provide us the problematic samples, source code snippet and complete stack trace. If the samples contain sensitive information and you are reluctant to share them with us then please check the EULA for NDA (clause 8). Moreover, we require such samples to reproduce and investigate the problem cause on our side, and we delete all such files as soon as the problem is fixed,

Thank you for your cooperation and understanding.

Hi Babar


We are using the below code:
for public static byte[] convertPDFToTiff(byte[] pdfIn)

{


OutputStream baos = new ByteArrayOutputStream();


try

{

License lic= new License();

lic.setLicense(Utility.class.getClassLoader().getResourceAsStream(“Aspose.Pdf.lic”));


com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(new ByteArrayInputStream(pdfIn));

com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(300);

com.aspose.pdf.devices.TiffDevice tiffDevice = new com.aspose.pdf.devices.TiffDevice(resolution);

tiffDevice.process(pdfDocument,1,1, baos);


baos.close();

}

catch(Exception e)

{

e.printStackTrace();

}


return ((ByteArrayOutputStream)baos).toByteArray();

}


public static void mergeTifs2(MergeTifResponse resp, List<byte[]> tifsIn)

{

byte[] x = new byte[1];

int pc = 0;


try

{


License lic= new License();

lic.setLicense(Utility.class.getClassLoader().getResourceAsStream(“Aspose.Pdf.lic”));


TiffImage result = new TiffImage();


for(byte[] tifData: tifsIn)

{

TiffImage source = (TiffImage)Image.load(new ByteArrayInputStream(tifData));


TiffFrame [] frames = source.getFrames();

for(int i = 0; i < frames.length; i++)

{

pc++;

result.addFrame(TiffFrame.copyFrame(frames[i]));

}//end for

}//end for


OutputStream out = new ByteArrayOutputStream();

result.save(out);


x = ((ByteArrayOutputStream)out).toByteArray();


resp.setPageCount(pc);

resp.setTifOut(x);

}

catch(Exception e)

{

e.printStackTrace();

}



}


Hi Amit,


Thank you for providing the source code to generate and merge TIFF files. We have worked with the sample code to generate the TIFF files with latest version of Aspose.Pdf for Java 9.7.0 and merged them using latest version of Aspose.Imaging for Java 2.4.0. Unfortunately, we are unable to experience any exception as discussed here and on your other thread. We are now quite sure that Aspose.Pdf for Java API is generating valid TIFF images and the problematic samples causing the exceptions on your end are generated with some other system. Please note, we cannot properly investigate the problem cause or promise to provide the fix due to unavailability of the said samples. If you have already shared the EULA with your legal team (as requested earlier), I am sure there are no hindrances in sharing your samples with us.

As soon as you provide the samples to replicate the issue(s) while using the latest version of Aspose.Imaging for Java 2.4.0, we will quickly move forward to investigate the problem cause, and consequently provide the fix at earliest possible.