---
name: "PS_new2"
section: "3"
platform: "linux"
package: "pslib-dev"
version: "0.4.8-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PS_new2"
---

# PS\_new2(3)

Creates a new PostScript document object

## NAME

PS\_new2 — Creates a new PostScript document object

## SYNOPSIS

\#include \<pslib.h\>

PSDoc \* PS\_new2((void  (\*errorhandler)(PSDoc \*p, int type, const char \*msg), void\* (\*allocproc)(PSDoc \*p, size\_t size, const char \*caller), void\* (\*reallocproc)(PSDoc \*p, void \*mem, size\_t size, const char \*caller), void  (\*freeproc)(PSDoc \*p, void \*mem), void   \*opaque)

## DESCRIPTION

Creates a new document instance. It does not create the file on disk  or in memory. It just sets up everything. You may pass your own error  handler and memory management functions. If you pass NULL values the  internal default handler and functions will be used. In such case you  may as well call [PS\_new(3)](/PS_new/3.md).

## RETURN VALUE

Pointer to new instance of PostScript document or NULL on  failure.

## SEE ALSO

[PS\_new(3)](/PS_new/3.md), [PS\_get\_opaque(3)](/PS_get_opaque/3.md), [PS\_delete(3)](/PS_delete/3.md)

## AUTHOR

This manual page was written by Uwe Steinmann uwe@steinmann.cx.
