This has started to happen to us recently:
Could not convert extension [docx] listitemUrl [Documenten Goedkeuring/cb-1314-0322.pdf] to PDF : Parameter is not valid.
DocumentConvertor: Will try to delete the created targetListItem.
DocumentConvertor:
Stack trace: at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at xf9a9481c3f63a419.x6fb77f4cc018ceba.x121bb8d08bced493(Image xe058541ca798c059, RectangleF x9b41b285ab728c73, ImageAttributes xdd5fd51358b7d5b6)
at xf9a9481c3f63a419.x6fb77f4cc018ceba.xa903f8f328b4c169(x5e9754e56a4f759f xd8f1949f8950238a)
at xf9a9481c3f63a419.x6fb77f4cc018ceba.x495baeffa83ca947(x845d6a068e0b03c5 xd8f1949f8950238a)
at xf9a9481c3f63a419.x3cd5d648729cd9b6..ctor(x5e9754e56a4f759f brush)
at x4f4df92b75ba3b67.x20a936294adb09c3.x38ef28be92579963()
at x4f4df92b75ba3b67.x20a936294adb09c3.WriteStream()
at x4f4df92b75ba3b67.x585f64260eb07f7b.WriteToPdf(x4f40d990d5bf81a6 writer)
at x4f4df92b75ba3b67.x438bb4a676d170de.x79442125d578605f(SortedList x3733a99ccc7ac0a3, x4f40d990d5bf81a6 xbdfb620b7167944b)
at x4f4df92b75ba3b67.x438bb4a676d170de.x17c56662e4294017(x4f40d990d5bf81a6 xbdfb620b7167944b)
at x4f4df92b75ba3b67.x0d8cdce10fda1cfd.xa0dfc102c691b11f()
at x6a671772ec29137f.xcd769e39c0788209.DoEndDocument()
at xf989f31a236ff98c.x6c74398bceb133f8.xa2e0b7f7da663553(x8556eed81191af11 x5ac1382edb7bf2c2)
at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
at Aspose.Words.Document.Save(Stream stream, SaveOptions saveOptions)
at Aspose.Words.Document.Save(Stream stream, SaveFormat saveFormat)
at VGC.CollegeProcedure.SPAdapterLayer.Helpers.DocumentConvertor.performConversion(Stream instream, String extension, String convertTo, Stream outputStream)
at VGC.CollegeProcedure.SPAdapterLayer.Helpers.DocumentConvertor.CreatePdfOf(SPListItem sourceListItem, String sourceAbsoluteUrl)
We cannot reproduce it at will, but once it starts happening to 1 document, it happens to all subsequent documents. We're using Aspose.Words 13.2.0.0
Hi Dirk,
Thanks for your inquiry. It would be great if you please share following detail for investigation purposes.
- OS (Windows Version)
- Architecture (32 / 64 bit)
- .NET Framework version
- Please attach your input Word document.
- Please share your code which throws this exception
- Please share some detail about your scenario in which you are facing this issue
Unfortunately,
it is difficult to say what the problem is without the documents. As soon as you get these pieces of information to
us we’ll start our investigation into your issue.
OS (Windows Version) -> Windows Server 2003 R2
Architecture (32 / 64 bit) -> 32
.NET Framework version -> 3.5
Please attach your input Word document. -> The error does not occur on any particular document.
Please share your code which throws this exception ->
When examining the stack-trace I included in my previous mail it clearly shows that the problem lies somewhere in your program, not in any particular piece of code I've written.
Please share some detail about your scenario in which you are facing this issue -> The problem seems most likely to occur when the server receives a significant load from the users i.e. many users that are simultaniously converting a large amount of documents. Once the error occurs, all subsequent documents will also fail.
Hi Dirk,
Thanks for sharing the detail. We will prepare the required platform to simulate the environment as of yours. As soon as everything is setup, we will test the issue at our end and will post the results here for your kind reference. However, we still need your documents for which you are getting this exception.
Thank you for your patience and understanding.
Hi Dirk,
Thanks for your patience. I have tested the scenario at Windows Server 2003 (32 bit), .NET Framework 3.5 using latest version of Aspose.Words v13.12 and have not found the shared issue. Please use the latest version of Aspose.Words. Hope this helps you. I have used the following code snippet to test this issue.
Aspose.Words.License lic = new
Aspose.Words.License();
lic.SetLicense(@"c:\Aspose.Words.lic");
try
{
for (int i = 0; i < 1000; i++)
{
Document doc = new
Document("c:\\input.docx");
//Set PDF options
Aspose.Words.Saving.PdfSaveOptions objOptions = new Aspose.Words.Saving.PdfSaveOptions();
objOptions.JpegQuality = 80;
objOptions.UseHighQualityRendering = false;
MemoryStream
dstStream = new MemoryStream();
doc.Save(dstStream, SaveFormat.Pdf);
dstStream.Dispose();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}