XPS Converter SDK

long MBegin()
long MSetImageParam (long id, long imagetype, long bitcount, long quality, long rotate, long width, long height, long xdpi, long ydpi, long compression, long multipage)
long MConvertToImage(long id, char *infile, char *outpath, char *filename)
long MConvertToPDF(long id, char *infile, char *outfile)
long MPDFEncrypt(long id, char *userpassword, char *ownerpassword, long encryptlevel, long printing, long copying, long changing, long adding)
long MPDFInformation(long id, char *title, char *subject, char *author, char *keywords, char *creator, char *producer)
long MPDFWatermark(long id, char *text, long fsize, long fcolor, long position, long angle, long xoff, long yoff, long background)
long MConvertToPS(long id, char *infile, char *outfile, long pslevel, char *pagesize, long width, long height, long expand, long shrink, long center, long duplex)
long MEnd(long id)


Detailed Description


  long MBegin ()
  Create a handle for convert.
  Parameters:  
  NULL  
  Return Value:  
  Return a handle if the create was successful, -1 if load "xpscore.dll" error, -2 if load "mstar.dll" error, otherwise 0.
   
   
  long MSetImageParam ( long id,
long imagetype,
long bitcount,
long quality,
long rotate,
long width,
long height,
long xdpi,
long ydpi,
long compression,
long multipage )
  Set the image parameter.
  Parameters:  
  id A handle to the file.
  imagetype Set generated image format. see ENUM_IMAGE_FORMATS.
  bitcount Set the color depth in the generated image file, 1=black and white, 3=16 grayscale, 4=16 colors, 7=256 grayscale, 8=256 colors, 24=true color. see COLOR_DEPTH.
  quality Set quality (1 ~ 100) in the generated JPEG file or TIFF file jpeg compression, default 75.
  rotate Set page rotate angle(0~360).
  width Set page width. e.g. width=1, height=1280, set height as 1280 pixels, and width to according to the pdf page size relative.
  height Set page height. e.g. width=800, height=1, set width as 800 pixels, and height to according to the pdf page size relative.
  xdpi Set horizontal resolution (72 ~ 600), default 72.
  ydpi Set vertical resolution (72 ~ 600), default 72.
  compression Set the Compression method in the generated TIFF file, this option is only available for TIFF files. see ENUM_TIFF_COMPRESSION.
  multipage The 1 is generate a multi-page TIFF file, the 0 is generate a TIFF file for each page, this option is only available for TIFF files
  Return Value:  
  Returns 1 if set is successfully, otherwise 0.
   
   
  long MConvertToImage (long id,
char *infile,
char *outpath,
char *filename)
  Convert to Image file.
  Parameters:  
  id A handle to the file.
  infile A string that is path to the input XPS file.
  outpath Set output path. If path is NULL or an empty string, it save in the same folder as source file.
  filename A string that is name to the output Image file.
  Return Value:  
  Returns 1 if convert is successfully, -1 if input xps path error, -2 if output Image path error, otherwise 0.
   
   
  long MPDFEncrypt (long id,
char *userpassword,
char *ownerpassword,
long encryptlevel,
long printing,
long copying,
long changing,
long adding)
  Set pdf encryption.
  Parameters:  
  id A handle to the file.
  userpassword Document Open password.
  ownerpassword Permissions password.
  encryptlevel Encryption Level. 128-bit, 40-bit.
  printing Permit Printing.
  copying Permit Content Copying or Extraction.
  changing Permit Changing the Document.
  adding Permit Adding or changing form fields.
  Return Value:  
  Returns 1 if successfully, otherwise 0.
   
   
  long MPDFInformation (long id,
char *title,
char *subject,
char *author,
char *keywords,
char *creator,
char *producer)
  Set pdf information.
  Parameters:  
  id A handle to the file.
  title Set 'title' to PDF file
  subject Set 'subject' to PDF file.
  author Set 'author' to PDF file.
  keywords Set 'keywords' to PDF file.
  creator Set 'creator' to PDF file.
  producer Set 'producer' to PDF file.
  Return Value:  
  Returns 1 if successfully, otherwise 0.
   
   
  long MPDFWatermark (long id,
char *text,
long fsize,
long fcolor,
long position,
long angle,
long xoff,
long yoff,
long background)
  Set pdf text stamping.
  Parameters:  
  id A handle to the file.
  text The content of the stamp.
  fsize Set the font size, default is 16 point.
  fcolor Specify the text color,range from 0-16777215,default is 255(red).
  position The Position of stamps.
1 = Stamps on the Top-Left of the page. (default)
2 = Stamps on the Top-Center of the page.
3 = Stamps on the Top-Right of the page.
4 = Stamps on the Right-Center of the page.
5 = Stamps on the Right-Bottom of the page.
6 = Stamps on the Bottom-Center of the page.
7 = Stamps on the Left-Bottom of the page.
8 = Stamps on the Left-Center of the page.
9 = Stamps on the Center of the page.
  angle The Angle for stamps,range from 0-360.
  xoff Offset from current position.
e.g 10 Move to right 10 point
e.g -10 Move to left 10 point
  yoff Offset from current position.
e.g 10 Move to bottom 10 point
e.g -10 Move to top 10 point
  background Placed text watermark under the existing content.
  Return Value:  
  Returns 1 if successfully, otherwise 0.
   
   
  long MConvertToPDF (long id,
char *infile,
char *outfile)
  Convert file to pdf file.
  Parameters:  
  id A handle to the file.
  infile A string that is path to the input XPS file.
  outfile A string that is path to the output PDF file.
  Return Value:  
  Returns 1 if convert is successfully, -1 if input xps path error, -2 if output pdf path error, otherwise 0.
   
   
  long MConvertToPS (long id,
char *infile,
char *outfile,
char *outfile,
long pslevel,
char *pagesize,
long width,
long height,
long expand,
long shrink,
long center,
long duplex)
  Convert file to ps file.
  Parameters:  
  id A handle to the file.
  infile A string that is path to the input XPS file.
  outfile A string that is path to the output PS file.
  pslevel Set postscript level. see PS_LEVEL.
  pagesize Set paper size. Support: "original, A0, A1, A2, A3, A4, A5, A6, B5, letter, legal, ledger, P11x17", or "custom".
  width Custom paper witdh.
  height Custom paper height.
  expand Expand pages smaller than the paper size.
  shrink Shrink pages larger than the paper size,
  center Center pages smaller than the paper size,
  duplex Enable duplex printing.
  Return Value:  
  Returns 1 if convert is successfully, -1 if input xps path error, -2 if output ps path error, otherwise 0.
   
   
  long MEnd (long id)
  Close the handle.
  Parameters:  
  id A handle to the file.
  Return Value:  
  Returns 1 if successfully, otherwise 0.

ENUM_IMAGE_FORMATS

Formats Value Support color depth, see COLOR_DEPTH.
IMAGE_FORMAT_BMP 1 1,, 3,, 4,, 7,, 8,, 24
IMAGE_FORMAT_EMF 2 24
IMAGE_FORMAT_WMF 3 24
IMAGE_FORMAT_JPG 4 7,, 24
IMAGE_FORMAT_PNG 5 1,, 3,, 4,, 7,, 8,, 24
IMAGE_FORMAT_GIF 6 1,, 3,, 4,, 7,, 8
IMAGE_FORMAT_TIF 7 1,, 3,, 4,, 7,, 8,, 24
IMAGE_FORMAT_PCX 8 1,, 3,, 4,, 7,, 8,, 24
IMAGE_FORMAT_TGA 9 7,, 8,, 24
IMAGE_FORMAT_JP2 10 7,, 24
IMAGE_FORMAT_RAS 11 7,, 24
IMAGE_FORMAT_JPC 12 7,, 24




ENUM_TIFF_COMPRESSION

Compression Value   Support color depth, see COLOR_DEPTH.
COMPRESSION_NONE 0 dump mode 1,, 3,, 4,, 7,, 8,, 24
COMPRESSION_LZW 1 Lempel-Ziv & Welch 1,, 3,, 4,, 7,, 8,, 24
COMPRESSION_JPEG 2 %JPEG DCT compression 7,, 24
COMPRESSION_PACKBITS 3 Macintosh RLE 3,, 4,, 7,, 8,, 24
COMPRESSION_CCITTFAX4 4 CCITT Group 4 fax encoding 1
COMPRESSION_CCITTFAX3 5 CCITT Group 3 fax encoding 1
COMPRESSION_CCITTRLE 6 CCITT modified Huffman RLE 1




ENUM_COLOR_BIT


Color Value  
BITCOUNT_1 1 black/white( 1 bits )
BITCOUNT_4G 3 16 color grayscale( 4 bits )
BITCOUNT_4 4 16 color( 4 bits )
BITCOUNT_8G 7 256 color grayscale( 8 bits )
BITCOUNT_8 8 256 color( 8 bits )
BITCOUNT_24 24 True color( 24 bits )

PS_LEVEL

Param Value  
M_LEVEL1 1 Level 1 PostScript
M_LEVEL1S 2 Level 1 Separable PostScript
M_LEVEL2 3 Level 2 PostScript (default)
M_LEVEL2S 4 Level 2 Separable PostScript
M_LEVEL3 5 Level 3 PostScript
M_LEVEL3S 6 Level 3 Separable PostScript



Technical Support

Any time that you need help while using products, please contact our support team at support@mgosoft.com.
We promise to our customers that we will deal with emails within 24 hours after receiving them.


Copyright © 2017 Mgosoft.com, Inc