This message was posted using Banckle Live Chat 2 Forum
This message was posted using Banckle Live Chat 2 Forum
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("<full path>/emd-2009-043098.pdf");
pdfDocument.save("/tmp/tempname.doc", SaveFormat.DocX);
I recently purchased Aspose.Pdf for .Net component.
From time to time, I'm getting NullReferenceException in the following line:
license.SetLicense("Aspose.Pdf.lic");
Please advise.
Thanks,
Ofer.
We recently purchased Aspose PDF component, by using below code snippet PDF files are converted to TIFF image.
Converted Tiff images –
1) Images are legitimate when it opens by using “IrfanImage”, “Microsoft office Document Imaging” tools. (Background color is : white and Text color is Black)
2) Same images when it opens by using “mspaint”, “Windows picture & Fax Viewer” tool – Image background coming in Black and Text in White color. Actually images suppose to be having white background and black text.
We would need a quick solution to view converted images uniformly in all image viewing tools. We appreciate quick response and solution.
Attached are:
1) Original PDF file.( 4831 EBDRTransactionAmountDiffersForm.pdf)
2) 4831 EBDRTransactionAmountDiffersForm_AsposeConverted.tif converted one.
Environment: JRE 7, OS: Linux and Windows.
Thanks
Raghu
Code Snippet:
SimpleDateFormat dateForamt=new SimpleDateFormat("dd-MM-yy:HH:mm:ss");
System.out.println("Image Conversion Start"+ dateForamt.format(System.currentTimeMillis()));
//Open document
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("C:\\ImageConversion\\Pdf\\ImageConversionNewtry\\EBDResolutionProcessForm(8).pdf");
//Create stream object to save the output image
java.io.OutputStream imageStream = new java.io.FileOutputStream("C:\\ImageConversion\\Pdf\\ImageConversionNewtry\\EBDResolutionProcessForm(8)_Converted.tif");
//Create Resolution object
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(200);
// instantiate TiffSettings object
com.aspose.pdf.devices.TiffSettings tiffSettings = new com.aspose.pdf.devices.TiffSettings();
// set the compression of resultant TIFF image
tiffSettings.setCompression(com.aspose.pdf.devices.CompressionType.CCITT4);
// set the color depth for resultant image
tiffSettings.setDepth(com.aspose.pdf.devices.ColorDepth.Format1bpp);
// skip blank pages while rendering PDF to TIFF
tiffSettings.setSkipBlankPages(false);
//Create TiffDevice object with particular resolution
com.aspose.pdf.devices.TiffDevice tiffDevice = new com.aspose.pdf.devices.TiffDevice(resolution,tiffSettings);
//Convert a particular page (Page 1) and save the image to stream
tiffDevice.process(pdfDocument,1,1, imageStream);
//Close the stream
imageStream.close();
dateForamt=new SimpleDateFormat("dd-MM-yy:HH:mm:ss");
System.out.println("After Save IMAGE"+ dateForamt.format(System.currentTimeMillis()));
Aspose.PDF .Net 10.5.0.0 fails to convert the attached PDF to PDF/a. It works with 10.4.0.0 and also with other documents.
The PDF was generated by Microsoft OneNote from a mail.
The Aspose error message is:
ExtGState 'ca' value shall be 1.0
ByteArrayOutputStream imageStream = new ByteArrayOutputStream();2)
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(dpi_Resolution);
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 90);
jpegDevice.process(converter.getDocument().getPages().get_Item(imageCount), imageStream);
imageStream.close();
byte[] jpgImageInBytes = imageStream.toByteArray();
Debug.print("jpegDevice: ----> \n" + jpgImageInBytes.length ); //here 176866
ByteArrayOutputStream imageStream = new ByteArrayOutputStream();
converter.setResolution(new Resolution(dpi_Resolution));
converter.getNextImage(baos, ImageFormatInternal.getJpeg(), 90);
baos.close();
byte[] jpgImageInBytes = baos.toByteArray();
Debug.print("jpegDevice: ----> \n" + jpgImageInBytes.length ); //here 375842
Could you be so kind to explain what wrong I do? Is it problem of quality?
Thank you in advance