We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

Empty <title> tags being created when loading PDF and EPub documents


We are reviewing the HTML within the reader and noticed that there are empty tags throughout the document. We are seeing this in both EPub and PDF documents. This will cause accessibility issues with our product and would like to understand why these empty tags are being created and how to either use them or get rid of them.

Thank you

MicrosoftTeams-image (1).png (35.4 KB)


We can reproduce this issue on our side. The simple workaround could be replacing <title> and </title> strings with the empty string. We’ll investigate this issue and update you.


Thank you for taking a look. This suggestion infers that we can control the HTML used in the viewer for displaying a document. If I am correct in that, do you have documentation on how to do this?

Thanks again


You have full control of the output produced by the Viewer. To replace text in the HTML you have to use a custom stream factory - a class that is responsible for instantiating the output stream and closing it. Find out an example in Save output to a stream.

The following code converts a file to HTML and replaces Title tags with empty strings.

List<MemoryStream> pages = new List<MemoryStream>();

using (Viewer viewer = new Viewer("sample.pdf"))
    MemoryPageStreamFactory pageStreamFactory = new MemoryPageStreamFactory(pages);

    ViewOptions viewOptions =


internal class MemoryPageStreamFactory : IPageStreamFactory
    private readonly List<MemoryStream> _pages;

    public MemoryPageStreamFactory(List<MemoryStream> pages)
        _pages = pages;

    public Stream CreatePageStream(int pageNumber)
        MemoryStream pageStream = new MemoryStream();


        return pageStream;

    public void ReleasePageStream(int pageNumber, Stream pageStream)
        MemoryStream memoryStream = (MemoryStream)pageStream;
        string html = Encoding.UTF8.GetString(memoryStream.ToArray());
        string result = html
            .Replace("<title>", string.Empty)
            .Replace("</title>", string.Empty);
        byte[] bytes = Encoding.UTF8.GetBytes(result);

        memoryStream.Write(bytes, 0, bytes.Length);


Thanks, we will work this today and get back to you if we have any questions.


You’re welcome!

Vladimir, we are all set on this one. Thanks for your help.


You’re welcome! Thank you for the feedback!