Hi,
I am using the trial version of Aspose Words.
It works great, but I can’t insert an image into the document programatically.
When I open the document I don’t get an error, but as soon as I scroll down where the picture is supposed to be, I get a MS Word warning “There is not enough memory or disk space to display or print the picture.”
I successfully insert this picture into word when I don’t use aspose. Here is the line of code I use:
(builder is Aspose.Words.DocumentBuilder. I know it is declared correctly because I am able to insert text into the document using this object successfully.)
Could I be having this problem because I am using the trial version of Aspose Words?
Thanks in advance!
Anya
Dear Anya,
Thank you for reporting the issue to us. No, trial version is supposed to work exactly as licensed one and no issues like that you’ve reported are expected. Could you please attach the image in question to test?
Dmitry,
I attached a test jpg I created for testing purposes.
When I insert the image into the word document (I am inserting into a document created by Aspose, not into an existing document), I notice that the size of my document is 175kb. That is much larger than the 25kb file I get when I create a document in ms word and insert picture from file.
The file size issue may be resolved once the insert image issue is resolved. Or is it a known issue that Word files created by Aspose and with an image inserted by Aspose are larger than files created by MS Word?
I am also ok using Aspose PDF to create my files in PDF format instead of DOC format. Would you recommend I do this instead of using Aspose Word?
Thanks for your prompt response. I am under a tight deadline to decide if Aspose will meet our needs.
Anya
Hi Anya.
When I created a document from scratch and inserted just one picture “test.jpg” it is okay. The document opens without any warning. Its size is 12K. When I save an empty doc it is 10K. So the picture doesn’t consume extra memory.
To reproduce this issue we would ask you to send us one of the following:
- the code creating the document up to the point where it is reproduced
- the document itself at the point before you insert the image.
Source code is preferable since the problem could exist before image insertion, on one of the previous stages.
Regards,
Viktor,
I recreated the img and set up a new project for testing. Today I was also able to insert the test image. After doing some more testing, I have traced the problem back to my original image. I am attaching the image to this post. The jpg image is created with vb.net from 2 bmp files. There must be something wrong with the jpg. I am going to look into a way of creating this jpg differently. I could use a suggestion on how to do this, but since its not an Aspose issue, I don’t expect you to have an answer.
But just in case you do…
The situation is, I have bmp (can also be a jpg) of user input (hand drawn lines in the image below). And I need to merge the user input with an image that labels user input (printed text and lines that appear in the image below.) I can put the image with the labels in any format (such as gif, which would have a transparent background.) I could probably create a watermark with Aspose… right? Can I put a watermark on top of an image, or does Aspose only support watermarks under text?
Thanks for your help guys, but I got it now. I changed the way my jpg is being generated and that fixed the problem.
I guess I kind of answered my own questions. Sorry for the hastle.
I’ve been evaluating Aspose for one day, and I really like your product and your response time. Good job guys! Keep it up!
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.