Free Support Forum - aspose.com

TextFragment issue

Hi Everyone,


I’m looking to use the Aspose product to manipulate PDFs for our company website. We are going to insert customer data into a PDF template. I’m using the trial version to test out the product at the moment. We are also using .net 4.0 and version 6.0 of the product.

Right now, I’m just testing with a pdf that has the text ‘Plain PDF Document’. When I get to this line of code:
TextFragment fragment = new TextFragment(“test”);

It throws this error:
The type initializer for ’ . ’ threw an exception.

This error is also thrown when I try and use the TextFragmentAbsorber as well.

I noticed that previous versions were having issues as well, not specific to TextFragment, but when declaring the pdf it would throw this same error.

Any help would be great!

Just a quick update, the Inner Exception is:


"Object reference not set to an instance of an object."

I’m not sure if this has anything to do with the file path of the pdf or not?

Thanks in advance for any help that can be given.

Hello Steve,

Thanks for your interest in our products.

Can you please share some details regarding the PDF document that you need to generate with Aspose.Pdf. However during my testing, I am unable to notice any problem when using the code snippet shared over
Add Text in an Existing PDF File

We are really sorry for your inconvenience.

Hi codewarior,


I am now using the Forms instead of trying to configure the document through Text. I have posted another thread regarding some issues I have. I have attached an image to give more examples of the issues I am having.

Thank you for the help