Please enable JavaScript to view this site.

Navigation: Developer Information > Command Line Interface > Command Line Convert To Format

Command Line Convert XPS To PNG

Scroll Prev Top Next More

Convert XPS To PNG Command Line

 

win2pdfd.exe convertto "sourcefile.xps" "destfile.png" png

win2pdfd.exe convertto "sourcefile.xps" "destfile.png" pnggray

win2pdfd.exe convertto "sourcefile.xps" "destfile.png" pngtransparent

win2pdfd.exe convertto "sourcefile.xps" "destfile.png" pnggraytransparent

 

Converts the XPS "sourcefile.xps" to a PNG image, and saves the converted image to "destfile.png". The last parameter controls the PNG format:

pnggray

PNG - Grayscale

png

PNG - Color

pnggraytransparent

PNG - Grayscale with transparent background

pngtransparent

PNG - Color with transparent background

 

If the XPS file is more than one page, all pages are converted as separate files one per page in the format:

 

destpng.1.png

destpng.2.png

...

destpng.n.png

 

Any file names that contain spaces must be enclosed with quotation marks. The "sourcefile" can be a local file path, or an web address (URL) to an existing XPS file.

 

This feature requires a licensed version of Win2PDF. Contact us for a time limited evaluation license.

 

Returns 0 on success, and a Windows system error code on failure.