As I see PdfOptions class of the Aspose.Imaging library, is very poor. There is almost no custom settings.
http://www.aspose.com/docs/display/pdfnet/Working+with+Images+%28Generator%29
)As I see PdfOptions class of the Aspose.Imaging library, is very poor. There is almost no custom settings.
http://www.aspose.com/docs/display/pdfnet/Working+with+Images+%28Generator%29
)Hello, Thank you for your reply.
_image = Image.Load(originalFileContent.ConvertToMemoryStream());
var options = new PdfOptions();<span style="color:blue;">var</span> outStream = <span style="color:blue;">new</span> <span style="color:#2b91af;">MemoryStream</span>(); _image.Save(outStream, options); outStream.Seek(0, <span style="color:#2b91af;">SeekOrigin</span>.Begin);
I got an exception in this line _image.Save(outStream, options);
and the exception is that
{“Cannot save to the specified format as it is not supported at the moment.\r\nParameter name: optionsBase”}" at Aspose.Imaging.Image.Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)\r\nat Aspose.Imaging.Image.Save(Stream stream, ImageOptionsBase optionsBase)\r\nat Imageware.Converter.BusinessLogic.AsposeSdk.AsposeImageDoc.Convert(ConversionJob job, Byte[] originalFileContent)in C:\ConverterLibrary\BusinessLogic\AsposeSdk\AsposeImageDoc.cs:line 58"
So as it is obviously seen, PdfOptions are not supported for that kind of usage (i dont know why it is exist in imaging module)
And the link that I gave you above, contains only adding a section and adding an image into the page and save it as PDF.
I was expecting that a direct image convertion to PDF not like adding image into the page.
and for PDF/A, I was expecting PdfOptions class would have a property which is Compliance that helps us to set PDF type like
option.Compliance = PdfCompliance.PdfA1a;
but in Imaging, PdfOptions does not contain anything and even pdfoptions is not supported for pdf convertion.
for example;for aspose word
I can directly save a doc file to pdf like
var option = new PdfSaveOptions
{
ZoomBehavior = _settings.AsposeWordSaveOption.ZoomBehavior,
ZoomFactor = _settings.AsposeWordSaveOption.ZoomFactor,
Compliance = _settings.AsposeWordSaveOption.PdfFormat
};
_wordDocument.Save(outStream, option);
but aspose imaging does not support that kind of way as i understand
Hello Ikram,
Thank you for your reply. I see that this class is not for common image formats such as png, jpeg etc. For these format i have to use PDF module.
Hi Ertan,
ertan2002:
Thank you for your reply. I see that this class is not for common image formats such as png, jpeg etc. For these format i have to use PDF module.
Thank you.
Thanks for your feedback. Yes you are right, Aspose.Imaging does not support Raster images(TIFF,PNG,JPEG etc) conversion to PDF but DjVu file format . So for your requirement you have to use Aspose.Pdf for images to PDF conversion and PDFA as following. Please feel free to contact us if you need any assistance in this regard.
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document();
Aspose.Pdf.Page page = pdfDocument.Pages.Add();
Aspose.Pdf.Image img = new Aspose.Pdf.Image();
img.File = "input.bmp";
page.Paragraphs.Add(img);
// Convert to PDF/A compliant document
pdfDocument.Convert("log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
String output = "PDFToPDFA_out.pdf";
// Save output document
pdfDocument.Save(output);
Best Regards,
Hey, we’re getting same problem as with jpg files as @iwagbe, here is how our code looks like:
public void ConvertToPdf(Stream inputStream, Stream outputStream)
{
using (var image = Aspose.Imaging.Image.Load(inputStream))
{
image.Save(outputStream, new Aspose.Imaging.ImageOptions.PdfOptions());
}
}
All PDF files are getting blank page after that, what are we doing wrong? Was that fixed in some aspose version? (we are on 19.11.0, .net core 3.1).
I also see that it should be possible:
I have observed that you are using older product version. I suggest you to please try using latest Aspose.Imaging for .NET 20.5 on your end. In case there is still an issue then please share the source file reproducing the issue on your end along with generated PDF.
Our license does not allow us to get to 20.5. See file attached.
image (7).png (19.3 KB)
It’s strange cause we paid for full license for all products. How can we get the new license key?
In order to get new license, you may please need to consult Aspose.Purchase forum for renewal of license file. For any technical query related to API, you are always welcome.
thanks, opened issue on that forum:
https://forum.aspose.com/t/get-license-key-for-latest-version/213217