:orphan:
# PetscViewerSetFromOptions
Sets various options for a viewer based on values in the options database.
## Synopsis
```
#include "petscviewer.h"
PetscErrorCode PetscViewerSetFromOptions(PetscViewer viewer)
```
Collective
## Input Parameter
- ***viewer -*** the viewer context
## Note
Must be called after `PetscViewerCreate()` but before the `PetscViewer` is used.
## See Also
[](sec_viewers), `PetscViewer`, `PetscViewerCreate()`, `PetscViewerSetType()`, `PetscViewerType`
## Level
intermediate
## Location
src/sys/classes/viewer/interface/viewreg.c
## Examples
src/dm/tutorials/ex10.c
src/dm/tutorials/ex9.c
src/mat/tutorials/ex10.c
src/ts/tutorials/ex11.c
## Implementations
PetscViewerSetFromOptions_ExodusII in src/dm/impls/plex/plexexodusii.c
PetscViewerSetFromOptions_ADIOS in src/sys/classes/viewer/impls/adios/adios.c
PetscViewerSetFromOptions_Binary in src/sys/classes/viewer/impls/binary/binv.c
PetscViewerSetFromOptions_CGNS in src/sys/classes/viewer/impls/cgns/cgnsv.c
PetscViewerSetFromOptions_Draw in src/sys/classes/viewer/impls/draw/drawv.c
PetscViewerSetFromOptions_GLVis in src/sys/classes/viewer/impls/glvis/glvis.c
PetscViewerSetFromOptions_HDF5 in src/sys/classes/viewer/impls/hdf5/hdf5v.c
PetscViewerSetFromOptions_Socket in src/sys/classes/viewer/impls/socket/send.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/interface/viewreg.c)
[Index of all Viewer routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)