itext7 pdfmerger using statements

JonJacobs

Member
Joined
Jul 28, 2022
Messages
8
Programming Experience
10+
I just added itext7 to my application, having determined it had the tools for merging pdf files in C#. In the various examples I have found online, they do not show the necessary using statements, so I cannot "use" the code in the examples. What are the using statement I need to create and use an instance of the pdfmerger? Thank you.
 
Did you bother to read the itext7 documentation? They should tell what namespaces you need for your using declarations.
 
Did you bother to read the itext7 documentation? They should tell what namespaces you need for your using declarations.
>They should tell what namespaces
The operative word is "should"
Yes. I read whatever I could find. I did find namespaces for a few things that don't deal with merging documents, but otherwise the search was a bust in that regard. Almost all of the "documentation" I found was nothing but outlines with no content. Where I could find content, it didn't deal with merging pdf files. That's why I posted here. Perhaps my searching skills were inadequate, but if the documentation I found had the information I needed, I wouldn't have asked.
 
If you go to the documentation for the class that you are using, it shows exactly what namespace that class is in. You then use that namespace in your using declaration.

For example:

The class: iText.Pdfa.PdfAXMPUtil is in the iText.Pdfa namespace. This is basic C# knowledge. What C# tutorial or book were you using to learn C#?
 
If you go to the documentation for the class that you are using, it shows exactly what namespace that class is in. You then use that namespace in your using declaration.

For example:

The class: iText.Pdfa.PdfAXMPUtil is in the iText.Pdfa namespace. This is basic C# knowledge. What C# tutorial or book were you using to learn C#?
I have found no documentation at all on pdfmerger. However, I found the namespace by trial and error. using iText.Kernel.Utils; Tedious and not the best way to go, but there it is.
>What C# tutorial or book were you using to learn C#?
That's a strange question. That was many years ago, so I couldn't remember even if it were relevant. I am not a novice to .Net or C#. I have used many libraries under .Net, and never have I had such difficulty obtaining relevant documentation. I downloaded the ebook Jump Start Tutorial for .Net, but it took quite a number of tries before it reported success. But the ebook has not arrived. I read various online excerpts from the book, including Getting Started, and never found a reference to namespaces.
 
Last edited:
Solution
Ah, I didn't look for java documentation, since I haven't used java in a long time, and I needed C# docs. Nevertheless, your link shows how to figure parallel classes based on the java classes. I'll have to remember that trick for future use. Thank you.
 
Ah, I didn't look for java documentation, since I haven't used java in a long time, and I needed C# docs. Nevertheless, your link shows how to figure parallel classes based on the java classes. I'll have to remember that trick for future use. Thank you.
>Here's the .NET version:
>iText 7 7.1.8 API: iText.Kernel.Utils.PdfMerger Class Reference
Thank you. I have put Index of /iText7/dotnet/ into my notes for future reference.
That never showed up in my searches, but I had "C#" as part of the search, so I didn't pull up Java references. If I had left out C# and just searched on itext7 + "Class Reference" it does appear as "iText Javadoc Home" which I would have ignored at first. Who would have guessed dotnet refs would be under Javadoc? Anyway thank you for the help.
 
Back
Top Bottom