# PetscViewerGetType
Returns the type of a `PetscViewer`. 
## Synopsis
```
#include "petscviewer.h" 
PetscErrorCode PetscViewerGetType(PetscViewer viewer, PetscViewerType *type)
```
Not Collective


## Input Parameter

- ***viewer -*** the `PetscViewer`



## Output Parameter

- ***type -*** PetscViewer type (see below)



## Available Types Include

- ***`PETSCVIEWERSOCKET` -*** Socket PetscViewer
- ***`PETSCVIEWERASCII` -*** ASCII PetscViewer
- ***`PETSCVIEWERBINARY` -*** binary file PetscViewer
- ***`PETSCVIEWERSTRING` -*** string PetscViewer
- ***`PETSCVIEWERDRAW` -*** drawing PetscViewer





## Note
See include/petscviewer.h for a complete list of `PetscViewer`s.

`PetscViewerType` is actually a string


## See Also
 [](sec_viewers), `PetscViewerType`, `PetscViewer`, `PetscViewerCreate()`, `PetscViewerSetType()`, `PetscViewerType`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/interface/view.c.html#PetscViewerGetType">src/sys/classes/viewer/interface/view.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/interface/view.c)


[Index of all Viewer routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
