Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jul 31, 2025 8:27 am

Hello ,

We are using spire pdf for java (11.7.0) to generate factur X document.

One requirement for embedded xml file is to have some information registered in the attachment associated dictionnary

If we use the Attachament.setFieldValue (String,String) methods , the information is not recognized by factur-x validator (it seems not to add information in the file dictionnary )

We founded an Attachment.getDictionnary() public method but it return an obsfucated object without any method associated ...

how can we manipulate attachment associated dictionnary ??

ghenry_talentia
 
Posts: 8
Joined: Fri Jul 11, 2025 1:36 pm

Thu Jul 31, 2025 10:07 am

Hello,

Thank you for your inquiry.
Could you please provide us with a complete runnable code demo, your pdf files and your xml files? This information will help us investigate your issue more accurately and offer an effective solution. It would be better if you could provide some screenshots illustrating the issue you're currently encountering.
You may upload the files as attachments or send them directly to my email: [email protected]. Thanks in advance.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 331
Joined: Mon Apr 14, 2025 3:33 am

Fri Aug 01, 2025 12:00 pm

Hello
Working poc attached to this ..

ghenry_talentia
 
Posts: 8
Joined: Fri Jul 11, 2025 1:36 pm

Mon Aug 04, 2025 8:45 am

Hello,

Thank you for your sharing.

The getDictionary() method is a method that will be reclaimed and its functionality is not publicly accessible. Regarding manipulating attachment associated dictionary, I recommend first adding your attachment normally, then using attachment.setFieldValue(String, String) to configure the properties you need before converting to PDF/A format. If the Factur-X validator still fails to recognize these settings, please send us screenshots of the specific validation errors. We will do further investigation. Thank you for your cooperation and understanding.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 331
Joined: Mon Apr 14, 2025 3:33 am

Fri Oct 17, 2025 8:52 am

Hello ,
Sorry for this late response ,

After moving to the latest spirePdf for java version , we found the Attachments.add(ttachment, pdf, PdfAttchmentRelationShip) method that fullfil our requirement .

Thanks

Regards

ghenry_talentia
 
Posts: 8
Joined: Fri Jul 11, 2025 1:36 pm

Fri Oct 17, 2025 9:35 am

Hello,

Thanks for the update. Please don't hesitate to reach out if you have any more questions or need further assistance.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF