here is my code to place a basic image on a pdf:
PdfFileMend mendor;mendor = new PdfFileMend(“bpmpe004.pdf”, “new.pdf”);mendor.AddImage(“TOLOGO.jpg”, 1, 116, 707, 299, 759);mendor.Close();
here is my code to place a basic image on a pdf:
PdfFileMend mendor;mendor = new PdfFileMend(“bpmpe004.pdf”, “new.pdf”);mendor.AddImage(“TOLOGO.jpg”, 1, 116, 707, 299, 759);mendor.Close();
After some more testing, I was able to get the Licensing and AddImage to work with version 3.8.0.1, but AddImage does not work on subsequent versions.
}PdfFileMend mendor;mendor = new PdfFileMend(“bpmpe004.pdf”, “new.pdf”);mendor.AddImage(inImgStream, 1, 116, 707, 299, 759);mendor.Close();inImgStream.Close();
Hi Zen,
I have tested these problems at my end and reproduced both of these issues. These issues have been logged in our issue tracking system as under:
PDFKITNET-14635 - Image is not placed properly
PDFKITNET-14637 - Problem adding image from a Stream
Our team will look into these issues and you’ll be updated via this forum thread once the issues are resolved.
We’re sorry for the inconvenience.
Regards,
The issues you have found earlier (filed as 14635;14637) have been fixed in this update.
Hi Shahzad,
Hi Freddy,
I have tested this issue using Aspose.Pdf.Kit for .NET 4.2.0, MemoryStram and a PNG image, but I couldn’t see any problem. Can you please make sure that the reference to the latest DLL was added successfully? If you still find any problem then please share your sample files (PDF and PNG) along with the code snippet, so we would be able to test the issue using your particular scenario.
We’re sorry for the inconvenience.
Regards,
This is the code snippet we use:
This fails: (System.ArgumentException with message = 'Parameter is not valid.')
PdfFileInfo fileInfo = new PdfFileInfo(pdffile);
float height = fileInfo.GetPageHeight(pageIndex);
float width = fileInfo.GetPageWidth(pageIndex);
using (FileStream inImgStream = new FileStream("d:\\barcode.png", FileMode.Open))
{
PdfFileMend mendor = new PdfFileMend(pdffile, output);
mendor.AddImage(inImgStream, 1, 0, 0, width, height);
mendor.Close();
inImgStream.Close();
}
This works:
PdfFileMend mendor = new PdfFileMend(pdffile, output);
mendor.AddImage("d:\\barcode.png", 1, 0, 0, width, height);
mendor.Close();
(please note that with these files the transparency ends up as black in the output file.)
Sincerely,
Freddy
Hi Freddy,
I have reproduced this problem at my end and logged it as PDFKITNET-15314 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is resolved.
We’re sorry for the inconvenience.
Regards,
The issues you have found earlier (filed as 15314) have been fixed in this update.
Hello,
It seems that the above fix breaks the transparent png functionality. (transparent png from stream into pdf) See the attached files (one made with 4.0.0 and one made with 4.3.0)
The 4.3.0 version gives black pages, the 4.0.0 works as it should.
We really need to get the latest version running because of the memory usage related errors in pre-4.2.0, but we keep running into problems. If we cannot get the problem fixed, we are forced by our customer to find a solution with other components..
Is it possible to do a quick-fix so we can start using the new version? (would within a few days be reasonable?)
Sincerely,
Fred
Hi Fred,
We’ll try to provide you a hotfix for this issue tomorrow.
We’re sorry for the inconvenience and appreciate your patience.
Regards,
Thank you, i hope this solves our problems.
Sincerely,
Fred
Hi Fred,
Please find a hotfix attached with this post.
I hope this helps. If you have any questions, please do let us know.
Regards,
The issues you have found earlier (filed as 15565) have been fixed in this update.