System.NullReferenceException when using PdfFormat.ZUGFeRD

Hello aspose support,

i`ve a problem converting a aspose document to ZugFerd format.

Aspose.PDF for .Net
Version 25.4.0

This line throws the folling exception:

pdf_file1.Convert(new MemoryStream(), PdfFormat.ZUGFeRD, ConvertErrorAction.Delete);

Exeption:
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei Aspose.Pdf.Forms.SignatureField.#=zXZEzrYTz7fsb(String #=zxwkCiQ_kP98x, #=zUwv3bMxuM8Cq_GwXTl_WSKOxJj7L$lQNgA== #=zwBl9M1M_Q$Ah)
bei Aspose.Pdf.Forms.SignatureField.#=zbzMfhq5JJr56()
bei Aspose.Pdf.Facades.PdfFileSignature.GetSignatureNames(Boolean onlyActive)
bei Aspose.Pdf.Facades.PdfFileSignature.GetSignNames(Boolean onlyActive)
bei Aspose.Pdf.Facades.PdfFileSignature.ContainsSignature()
bei #=zzFblxOlNtqCiJiDMEgFOvde3eggbS1ZmFNw7$F4n05CqCj7DEocGw1A=.#=zxXA2lu5uMJLM()
bei #=zzFblxOlNtqCiJiDMEgFOvde3eggbS1ZmFNw7$F4n05CqCj7DEocGw1A=.#=z4KNVXImMqmBo()
bei #=zzFblxOlNtqCiJiDMEgFOvde3eggbS1ZmFNw7$F4n05CqCj7DEocGw1A=.#=zcmQE7WQ=()
bei #=zkJrYNhVG0Lc$8YGa_5NFo0xZODxTQMrhEKG7Edjb2sjZzgR5ekAruwg=.#=zkL6WBoA=()
bei #=zzFblxOlNtqCiJiDMEgFOvde3eggbS1ZmFNw7$F4n05CqCj7DEocGw1A=.#=zb8QgZN0=(XmlTextWriter #=zCWDDP$Y=, PdfFormat #=zT4sUpgE=, Document #=zcEvbIbo=, Boolean #=zs$4QT7T9bYaD, ConvertErrorAction #=zhSB3zIY=)
bei Aspose.Pdf.Document.#=zzFxYPrY=(XmlTextWriter #=zCWDDP$Y=, PdfFormat #=zT4sUpgE=, Boolean #=zs$4QT7T9bYaD, ConvertErrorAction #=zhSB3zIY=)
bei Aspose.Pdf.Document.Convert(Stream outputLogStream, PdfFormat format, ConvertErrorAction action)

What im doing?

I have a folder full of pdfs.
The first pdf is alreday a zugferd pdf.

Now i add all the following pdfs to the first pdf like this:
pdf_file1.Pages.Add(pdf_file2.Pages);

After that i check if the first pdf is really a zugferd pdf like this:
if (pdf_file1.EmbeddedFiles.Count > 0)
if (attachment != null && attachment.Name.EndsWith(“.xml”))
{…

After that i try to convert and save the pdf.
pdf_file1.Convert(new MemoryStream(), PdfFormat.ZUGFeRD, ConvertErrorAction.Delete);
pdf_file1.Save(Path.Combine(destination, name));

But sometimes (not always) the convert crashes.

It would be great if you could help me.

Kind regards,
Oliver

@olterm

Can you please share your sample source PDF document with us? We will test the scenario in our environment and address it accordingly.

PM_P010628160_20250412_015830.zip (1,3 MB)

Hi aspose Support.
Here is the folder with the pdfs.

The first doc is a ZugFerd.

The Job is to attach all following pdf (order by filename).

The result should be also a ZugFerd-PDF.

Thanks for your help.

Kind rergards
Oliver

@olterm

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-59727

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@asad.ali Will you inform me, when Issue ID(s): PDFNET-59727 is solved? Best regards Oliver

@olterm

The ticket has recently been logged in our issue tracking system and will be prioritized on a first come first serve basis. As soon as we make some progress towards its resolution, we will inform you via this forum thread. Please be patient and spare us some time.

We are sorry for the inconvenience.