:orphan:
# PetscViewerASCIIPrintf
Prints to a file, only from the first processor in the `PetscViewer` of type `PETSCVIEWERASCII`
## Synopsis
```
#include "petscviewer.h"
PetscErrorCode PetscViewerASCIIPrintf(PetscViewer viewer, const char format[], ...)
```
Not Collective, but only the first MPI rank in the viewer has any effect
## Input Parameters
- ***viewer -*** obtained with `PetscViewerASCIIOpen()`
- ***format -*** the usual printf() format string
## Fortran Note
The call sequence is `PetscViewerASCIIPrintf`(`PetscViewer`, character(*), int ierr) from Fortran.
That is, you can only pass a single character string from Fortran.
## See Also
[](sec_viewers), `PetscPrintf()`, `PetscSynchronizedPrintf()`, `PetscViewerASCIIOpen()`,
`PetscViewerASCIIPushTab()`, `PetscViewerASCIIPopTab()`, `PetscViewerASCIISynchronizedPrintf()`,
`PetscViewerCreate()`, `PetscViewerDestroy()`, `PetscViewerSetType()`, `PetscViewerASCIIGetPointer()`, `PetscViewerASCIIPushSynchronized()`
## Level
developer
## Location
src/sys/classes/viewer/impls/ascii/filev.c
## Examples
src/dm/field/tutorials/ex1.c
src/dm/label/tutorials/ex1.c
src/dm/label/tutorials/ex1f90.F90
src/ksp/ksp/tutorials/ex68.c
src/ksp/ksp/tutorials/ex69.c
src/snes/tutorials/ex15.c
src/snes/tutorials/ex48.c
src/snes/tutorials/ex6.c
src/snes/tutorials/ex70.c
src/sys/classes/viewer/tutorials/ex1.c
src/ts/tutorials/ex14.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/ascii/filev.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)