We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Index was outside the bounds of the array exception and CSS not being applied

I have put together a simple example to illustrate that the CSS is never applied to the PDF file. But before I could get that issue resolved, I’ve encountered an exception. Can you let me know if it is something I’m doing or is something wrong with ASPOSE.PDF. This example expects to be extracted to the C:\TEMP folder.

I keep getting an error when trying to upload my example.

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

You will need to add ASPOSE.PDF from NuGet for this example to work. I had to remove ASPOSE package in order for the upload to work. I was using 10.2.

Hi Jim,


Thanks for contacting support.

I have tested the scenario using Aspose.Pdf for .NET 10.2.0 in Visual Studio 2012 application with target platform as .NET Framework 4.0, running over Windows 7 (x64) and I am unable to notice any issue. For your reference, I have also attached the resultant file generated over my end.

[C#]

string html = File.ReadAllText(@“C:\Temp\Temp\test.html”);<o:p></o:p>

HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();<o:p></o:p>

MemoryStream ms1 = new MemoryStream(Encoding.UTF8.GetBytes(html));<o:p></o:p>

<o:p> </o:p>

Document doc = null;<o:p></o:p>

doc = new Document(ms1, htmlLoadOptions);<o:p></o:p>

doc.Save(@“C:\Temp\Temp\test.pdf”);

The files I sent should all be in the C:\Temp folder not C:\Temp\Temp. If you launch the HTML file in a browser, you should see that all the CSS is applied and the resulting page looks nice. The PDF you sent is lacking all styling because ASPOSE didn’t find any of the CSS files. Can you try it again by moving everything to C:\Temp?

Hi Jim,

Thanks for your feedback. We have tested your shared document using Aspose.Pdf for .NET 10.2.0 and managed to observe the reported exception. For further investigation, I have logged an issue in our issue tracking system as PDFNEWNET-38482 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

Please feel free to contact us for any further assistance.

Best Regards

Any update on this?

Hi Jim,


Thanks for your patience.

The issue reported earlier is pending for review as the team will start investigating it according to their schedule. However as soon as we have some definite progress towards its resolution, we will let you know.

Can I get an ETA of when this issue will be looked at or some sort of work around? My project is nearing completion and I need some sort of solution.

Hi Jim,


Please note
that as a normal rule of practice, issues are resolved in first come and first
serve basis; but the problems logged/reported under Enterprise or Priority
support model, have high precedence in terms of resolution, as compare to
issues under normal/free support model. As your earlier reported issue is under normal support model, so it will be investigated/resolved as per development schedule.


However I have shared your concerns with development team and as soon as we have some further updates, we will let you know.

The issues you have found earlier (filed as PDFNET-38482) have been fixed in Aspose.PDF for .NET 20.1.