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

Free Support Forum - aspose.com

Parameters are not valid

Hello,

I got an issue while converting the pdf in attachment using this code :

string jpgImg = @“D:\e1081358-aed1-4d1f-a48c-cc5fd4490b9a~002~Biglietto_MOBY_5201787047.jpg”;
byte[] pdf = File.ReadAllBytes(@“D:\e1081358-aed1-4d1f-a48c-cc5fd4490b9a~002~Biglietto_MOBY_5201787047.pdf”);
byte[] img = null;
PdfComponent.ConvertPDFToJpeg(pdf, ref img, 1,150, 50);
File.WriteAllBytes(jpgImg, img);

That’s the stack trace :

Comdata.Kofax.UnitTest.PdfComponentTest.ConvertToJpeg:
System.InvalidOperationException : Parameters are not valid
at .–.( )
at e.e.( , Queue )
at e.e.(‡ ,  )
at .–.()
at Aspose.Pdf.Devices.ImageDevice.(Page )
at Aspose.Pdf.Devices.JpegDevice.Process(Page page, Stream output)
at Comdata.Core.PdfComponent.ConvertPDFToJpeg(Byte[] pdfFileBuffer, Byte[]& jpgFile, Int32 numPag, Int32 resolution, Int32 quality) in D:\Projects\GED\API\Common\Source\Comdata\PdfComponent.cs:line 555
at Comdata.Kofax.UnitTest.PdfComponentTest.ConvertToJpeg() in D:\Projects\GED\API\Common\Source\Comdata.Kofax.UnitTest\PdfComponentTest.cs:line 146

Thanks,

Fabio D’Antonio
1 Like

Hi Fabio,

Thanks for using our products and sorry for replying you late. I am working over this query and will get back to you soon. We are sorry for the delay and inconvenience.

Hi Fabio,

I have tested the scenario using Aspose.Pdf for .NET 7.0.0 where I have used the following code snippet to convert the PDF document into JPEG format and I am unable to notice any exception. However I have observed that the BarCode in resultant JPEG shows Purple color in place of white spaces. For the sake of correction, I have logged this problem as PDFNEWNET-33923 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time.

Please note that I have used VisualStudio 2010 project with target platform as .NET Framework 4.0_ClientProfile, running over Windows 7 Enterprise X64. In case you still face the problem while using Aspose.Pdf for .NET 7.0.0, please share the details regarding your working environment and the share the complete code snippet that you are using. We are sorry for your inconvenience.

PS, For your reference, I have also attached the resultant JPEG that I have generated.

The issues you have found earlier (filed as PDFNEWNET-33923) have been fixed in Aspose.Pdf for .NET 7.5.0.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

is there any other solution available to convert into Tiff file from PDF ?

                Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(sourceFile);
                Aspose.Pdf.Devices.Resolution resolution7 = new Aspose.Pdf.Devices.Resolution(300);
                

                Aspose.Pdf.Devices.TiffSettings tiffSettings8 = new Aspose.Pdf.Devices.TiffSettings();

                tiffSettings.Compression = AsposeCompression;

                tiffSettings.Depth = AsposeColorDepth;
                tiffSettings.Shape = Aspose.Pdf.Devices.ShapeType.None;
                tiffSettings.Brightness = 0.25F;
                tiffSettings.SkipBlankPages = true;
                tiffSettings.Compression = CompressionType.CCITT3;
                Aspose.Pdf.Devices.TiffDevice tiffDevice = new Aspose.Pdf.Devices.TiffDevice(resolution, tiffSettings);

                tiffDevice.Process(pdfDocument, targetFile,);------------------>Error occurssaying invalid parameters
              //  pdfDocument.Save(targetFile);

Error:
at .Ž.( )
at ..( , Queue )
at ..( ,  )
at €.‹.()
at Aspose.Pdf.Devices.TiffDevice.Process(Document document, Int32 fromPage, Int32 toPage, Stream output)
at Aspose.Pdf.Facades.PdfConverter.SaveAsTIFF(Stream outputStream, Int32 imageWidth, Int32 imageHeight, TiffSettings settings)
at Aspose.Pdf.Facades.PdfConverter.SaveAsTIFF(String outputFile, Int32 imageWidth, Int32 imageHeight, TiffSettings settings)

@asish312

Thanks for contacting support.

Would you please try using latest version Aspose.PDF for .NET 19.2 to convert PDF into TIFF. In case issue still persists, please share your sample PDF document with us. We will test the scenario in our environment and address it accordingly.

1 Like