Set filename when viewing archive files

When viewing the archive files GroupDocs.Viewer displays an archive filename in the header of each page, like it is shown on the screenshot above. By default, the name of the original file is used. The GroupDocs.Viewer enables you to change or hide filename by setting FileName option of the ArchiveOptions class. The FileName option can be set to: 

The following code snippet shows how to set “my filename” instead of source filename when viewing an archive file.

using (Viewer viewer = new Viewer("sample.zip"))
{
    PdfViewOptions viewOptions = new PdfViewOptions();
    viewOptions.ArchiveOptions.FileName = new FileName("my filename");

    viewer.View(viewOptions);
}

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured .NET library we provide simple but powerful free Apps. You are welcome to view Word, PDF, Excel, PowerPoint documents with free to use online GroupDocs Viewer App.