EMF2PDF SDK Pilot Structures struct pdf_document { PDFDocument4 *pdfdoc; }; PDF Document structure, that need for managing of PDF file. It uses in all functions from EMF2PDF SDK. typedef enum { conone = 0, coflate = 1 } CompressionType; EMF2PDF SDK supports the following compression types: conone (=0) None; coflate (=1) - Use the "flate" method. EMF2PDF SDK Pilot Functions void pdf_init( Create and initialize PDF object. void pdf_free( Release PDF object. void pdf_setlicensedata( pdf_document &doc, const char *name, const char *key) This function sets user license data to remove all demo version limitations. void pdf_setauthor(pdf_document &doc, const wchar_t *author) void pdf_settitle(pdf_document &doc, const wchar_t *title) void pdf_setcreator(pdf_document &doc, const wchar_t *creator) information about the author of the information about the title of the current PDF document. information about the creator of the
void pdf_setkeywords(pdf_document &doc, const wchar_t *keywords) This function sets the keywords for the void pdf_setproducer(pdf_document &doc, const wchar_t *producer) void pdf_setproducepdfa( pdf_document &doc, bool pdfa) bool pdf_getproducepdfa( void pdf_setcompression( pdf_document &doc, CompressionType type) CompressionType pdf_getcompression ( bool pdf_setpageresolution( resolution) information about the producer of the This function sets the value indicating whether to produce a PDF/A compatible output file. This function returns the value indicating whether to produce a PDF/A compatible output file. This function sets the value indicating whether PDF page streams are compressed or not. This function returns the value indicating whether PDF page streams are compressed or not. This function sets the resolution (in DPI) of the size_t pdf_getpageresolution( This function returns the resolution (in DPI) of the bool pdf_setpageheight(pdf_document &doc, size_t height) This function sets the height of the size_t pdf_getpageheight( This function returns the height of the bool pdf_setpagewidth(pdf_document &doc, size_t width) This function sets the width of the
size_t pdf_getpagewidth( This function returns the width of the bool pdf_addmetafile(pdf_document &doc, const wchar_t *metafilename) This function adds a metafile from a file to a PDF document. bool pdf_playmetafile(pdf_document &doc, const wchar_t *metafilename, float x, float y, float scalex, float scaley) This function adds a metafile from a file to a PDF document. bool pdf_playmetafilefromhandle( pdf_document &doc, unsigned int metafilehandle, float x, float y, float scalex, float scaley) This function adds a metafile from a handle to a PDF document. bool pdf_open(pdf_document &doc, const wchar_t *filename, const char This function opens an existing PDF document, reads and parses its contents. bool pdf_openfrombuffer( pdf_document &doc, const unsigned char* documentbuffer, size_t buffersizeinbytes, const char This function opens an existing PDF document from a buffer, reads and parses its contents. bool pdf_append(pdf_document &doc, const wchar_t *filename, const char This function appends the contents of a previously saved PDF file (not a buffer) to a newly created (or opened) PDF document. bool pdf_appendfrombuffer( pdf_document &doc, const unsigned char* documentbuffer, size_t buffersizeinbytes, const char This function appends the contents of a previously saved buffer to a newly created (or opened) PDF document.
bool pdf_newpage(pdf_document &doc) bool pdf_addpage(pdf_document &doc) size_t pdf_addwatermark( This function creates a new PDF page, appends it to the end of the PDF document, and makes it current. This function creates a new PDF page, appending it to the end of the PDF document. This function creates a watermark in a PDF document. size_t pdf_addwatermark2( pdf_document &doc, bool showonbackground) This function creates a watermark in a PDF document. Show background. bool pdf_switchtowatermark( watermarknumber) This function switches all output commands to the specified watermark. void pdf_switchtocurrentpage( bool pdf_attachwatermark( pagenumber, size_t watermarknumber) This function switches all output commands back to the current PDF page. This function attaches a watermark to a page. bool pdf_setcurrentpage( pagenumber) This function sets the index of the bool pdf_savetofile (pdf_document &doc, const wchar_t *name, bool autolaunch) This function saves a PDF document to the file specified. size_t pdf_getbuffersize( This function returns the size (in bytes) of a PDF file generated in memory.
size_t pdf_getbuffer(pdf_document &doc, const unsigned char** pbuffer) This function returns a generated PDF document as a byte array.