Clear pdf metadata producer and create

How do i clear the producer and creator metadata values? Here is my code, the console shows no output for these once removed, however when i use a metadata finder online they still appear.

           // Open document
            Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(pdfFile);
            // Get document information
            DocumentInfo docInfo = pdfDocument.Info;

            //docInfo.Remove("Producer");
            docInfo.Remove("Creater");

            docInfo.Clear();

            docInfo.Producer.Replace("Aspose.PDF for .NET 19.5", "");

            docInfo.CreationDate = DateTime.Now;
            docInfo.ModDate = DateTime.Now;

            Console.WriteLine("Author: {0}", docInfo.Author);
            Console.WriteLine("Creation Date: {0}", docInfo.CreationDate);
            Console.WriteLine("Keywords: {0}", docInfo.Keywords);
            Console.WriteLine("Modify Date: {0}", docInfo.ModDate);
            Console.WriteLine("Subject: {0}", docInfo.Subject);
            Console.WriteLine("Title: {0}", docInfo.Title);
            Console.WriteLine("Producer: {0}", docInfo.Producer);
            Console.WriteLine("Producer: {0}", docInfo.Creator);

@smooney1234

We would like to share with you that you cannot change/remove/update the producer or creator value in PDF file information as Aspose.PDF for XXX would be shown against them. However, in case you need any other information, please feel free to let us know.

This is a real problem for us as it was highlighted as a security concern during penetration testing that we must address.

yeah same for us. it is a security concern, is there any chance this could be introduced or any rational as to why it cannot?

@smooney1234, @damong

As per our company policy, we are afraid that we cannot offer such functionality to change the creator or producer name against PDF properties. The limitation is already mentioned in the API documentation.

It is a piety that the company policy is to compromise the security of people using your libraries.
We will seek other means of producing PDF’s without leaking this information.

@damong

We apologize if it caused any inconvenience. We will surely share more information in case we have some regarding this scenario in future.

This is really bad, we don’t want to expose what libs we are using in our backend.

@Kranton

At the moment, we cannot implement this feature as per company policy. However, if we plan to offer this in future, we will inform you.

I have the same issue…

I don’t understand this “company policy”, can you explain ? This is a show stopper for us…

@Whiletrue

We are looking into this matter and trying to work out some strategies in this regard. We will get back to you on this matter soon. Please spare us some time.

Any news on this? We are having the same issue reported by a penetration test.
This company policy of Aspose is not state of the art regarding modern security thinking (hiding vendor/tool information to reduce attacking vectors)!
KR, Stefan

@stefan.raubal

We would like to share with you that you can now change the author name with using the latest version of the API. Please check the following code:

Document doc = new Document();
doc.Info.Producer = "Custom producer";
doc.Info.Creator = "Custom creator";

After save the document, Producer and Creator should be set to custom values.
If Producer and Creator are not set, then these values should be set to Aspose.PDF for .NET and Aspose, Ltd.

Thanks @asad.ali,

that’s indeed great news! :smiley: Many enterprise customers will be happy about that!

As we are using Aspose for Java, is it fixed there as well? And in which version exactly? (In the release notes of 22.10 it’s not yet mentioned.)

And one more question: Is there a way when converting a Word document (or any other supported format) to PDF to set that information in the PdfSaveOptions (as the document instance would be a Word document, not yet a PDF).
Or does it mean that after conversion we have to instantiate the PDF document to change these values, then save it (which will be resource and time consuming)?

KR, Stefan

@stefan.raubal

The feature was implemented in 21.2 version of .NET API and it should be present in the equivalent version of Java API.

Furthermore, we are afraid that you cannot set the properties for Word files or any other files as Aspose.PDF is specialized to deal with only PDF files and manipulate its properties. However, you can change these properties after obtaining the output PDF as you already mentioned. You can also post question about other file formats like DOC/DOCX in respective API forum like Aspose.Words.

1 Like