Home  Image2PDF  Document  Support  Articles  Products  Downloads
Image2PDF OCX library manual

http://www.verypdf.com

support@verypdf.com

very_id VeryCreateEx(char *filename)

Description

Create a PDF file.

Parameters

filename  

File name.

Return Value

Each of these functions returns a PDF File id for the Created file. A return value of 0 indicates an error, otherwise is succeed.

very_id VeryOpenEx(char *filename)

Description

Open a PDF file.for append

Parameters

filename  

File name.

Return Value

Each of these functions returns a PDF File id for the opened file. A return value of 0 indicates an error, otherwise is succeed.

 

Void VeryCloseEx(very_id id)

Description:

Close the opened PDF file.

Parameters

Id

       Returned by VeryCreate and VeryOpenEx function.

Return Value

              none

 

long VeryAddImageEx(very_id id, char *filename)

Description

Insert image file into an opened PDF file, supports JPEG and TIFF and PNG format, this function also support multi-page TIFF file, if you want specify a page range in the multi-page TIFF file, you must call VerySetFunctionEx (code = 101) to set the page range before you use this function, please refer to the VerySetFunctionEx function for get more information.

Parameters

Id

       Returned by VeryCreateEx or VeryOpenEx function.

       filename  

              Image filename

Return Value

If this function return ¨C1, indicate width or height large than 14400 pixel), A return value of 0 indicates an error, otherwise is succeed.

 

long VeryAddImageDataEx(very_id id, char *data, long width, long height, long color)

Description

Insert memory bitmap into PDF file.

Parameters

Id

       Returned by VeryCreateEx or VeryOpenEx function.

       data

Bitmap bits.

              width

Specifies the width of the bitmap, in pixels.

              height

Specifies the height of the bitmap, in pixels.

              color

                     Specifies the number of bits per pixel. 

1 : The bitmap is monochrome

8 : The bitmap has a maximum of 256 gray colors

24 : The bitmap has a maximum of 2^24 colors

Return Value

Nonzero if it is successful; otherwise, it is zero.

Remarks

The width of bitmap data must be aligning by 32 bits.

 

long VerySetFunctionEx(very_id id, long code, long para1, long para2, char *para3,char *para4)

Description

              Set some options before you use some special functions.

Parameters

Id

       Returned by VeryCreateEx or VeryOpenEx function.

code      

       Specifies the function index, this parameter must be one of the following values.

Code = 101

Set multi-page options, this code can be used before call VeryAddImageEx function.

para1

Begin page number.

                            para2

Page count from ¡°para1¡±, if para1 and para2 all equal 0, the page range will be reset to default setting (from first to last page).

                            Para3

                                   Ignore

                            Para4

                                   Ignore

Return Value

Nonzero if it is successful; otherwise, it is zero.

              Code = 104

Set image x, y, width and height options in PDF page, if the width and height not equal image original information, this image will be stretched automatically,

Para1

X position

Para2

Y position

Para3

Image width in pixel, e.g. Para3 equal "200".

Para4

Image height in pixel, e.g. Para4 equal "200".

Remarks

if para3 and para4 equal 0 then keep image original size¡£

Return Value

Nonzero if it is successful; otherwise, it is zero.

              Code = 105

Set encrypts information.

Para1

Encryption Level, it will equal 40 or 128, indicate 40-bit RC4 or 128-bit RC4.

                            Para2

                                   Document permissions

                                   Bit1: 1 allows printing, 0 is not.

                                   Bit2: 1 allows content copying or extraction disable accessibility.

                                   Bit3: 1 allows changing the document, 0 is not.

                                   Other Bits ignored.

                            Para3

                                   Owner password, it may equal NULL

                            Para4

                                   Open document password, it may equal NULL

                            The encryption setting will be restored if para1 para2 para3 para4 all equal 0.

Return Value

Nonzero if it is successful; otherwise, it is zero.

Code = 106

Set font name and font size, this code can be used before call VeryAddText1Ex and VeryAddText2Ex function.

                            Para1

                                   Font code, see following table

Para1

Font name

100

Times-Roman

101

Times-Bold

102

Times-Italic

103

Times-Bold-Italic

200

Courier

201

Courier-Bold

202

Courier-Oblique

203

Courier-Bold-Oblique

300

Helvetica

301

Helvetica-Bold

302

Helvetica-Oblique

303

Helvetica-Bold-Oblique

400

Symbol

                                                 font code table (table one)

                            Para2

                                   Font size

                            Para3

                                   Ignore

                            Para4

                                   Ignore

Return Value

Nonzero if it is successful; otherwise, it is zero.

              Code = 109

                            Create a blank page or close current page.

                            Para1 and para2 specify a new page size and other parameters will be ignored.

                                   para1=para2=1 : A3     

                                   para1=para2=2 : A4

                                   para1=para2=3 : A5

                                   para1=para2=4 : B5

                                   para1=para2=5 : letter

                                   para1=para2=6 : legal      

The para1 is page width and para2 is height, you can specify any value in pixels, the range is from 10 pixel to 14400 pixel.

                                   If para1 = para2 = 0, current page will be closed.

                            Para3

                                   Ignore

                            Para4

                                   Ignore

 

Return Value

Nonzero if it is successful; otherwise, it is zero.

              Code = 110

                            Add bookmark into current page, one page only use one bookmark.

                            Para3

                                   Bookmark content.

                            Otherwise parameters ignore.

Return Value

Nonzero if it is successful; otherwise, it is zero.

 

long VeryGetFunctionEx(very_id id, long code, long para1, long para2, char *para3, char *para4)

Description

              Get special information from the setting.

Parameters

Id

       Returned by VeryCreateEx or VeryOpenEx function.

code      

       Specifies the function index, this parameter must be one of the following values

Code = 201

Get page count from specify image file.

Para1

Ignore

Para2

Ignore

Para3

Image filename

Para4

Ignore

Return Value

                     Page number in this image file, 0 is failed

              Code = 202 

                     Get images width and height.

Para1

[out parameters ] save images width, it may equal NULL

usage:     (long)& width if width is variable

(long) width if width is pointer

Para2

[out parameters ] save images height, it may equal NULL

usage:     (long)&height if height is variable

(long)height if height is pointer

Para3

Image filename

Para4

images page number, e.g. first page is ¡°1¡± ,it may equal NULL

Return Value

Image width if it is successful; otherwise, it is zero.

 

 

              Code = 203 

                     Get images width and height.

Para1

[out parameters ] save images width, it may equal NULL

usage:     (long)& width if width is variable

(long) width if width is pointer

Para2

[out parameters ] save images height, it may equal NULL

usage:     (long)&height if height is variable

(long)height if height is pointer

Para3

Image filename

Para4

images page number, e.g. first page is ¡°1¡± ,it may equal NULL

Return Value

Image height if it is successful; otherwise, it is zero.

 

              Code = 204 

                     Get images DPI resolution

Para1

[out parameters ] save images DPI x-resolution, it may equal NULL

usage:     (long)& xdpi if xdpi is variable

(long) xdpi if xdpi is pointer

Para2

[out parameters ] save images DPI y-resolution, it may equal NULL

usage:     (long)& ydpi if ydpi is variable

(long) ydpi if ydpi is pointer

Para3

Image filename

Para4

images page number, e.g. first page is ¡°1¡± ,it may equal NULL

Return Value

Image DPI x-resolution if it is successful; otherwise, it is zero.

 

              Code = 205 

                     Get images DPI resolution

Para1

[out parameters ] save images DPI x-resolution, it may equal NULL

usage:     (long)& xdpi if xdpi is variable

(long) xdpi if xdpi is pointer

Para2

[out parameters ] save images DPI y-resolution, it may equal NULL

usage:     (long)& ydpi if ydpi is variable

(long) ydpi if ydpi is pointer

Para3

Image filename

Para4

images page number, e.g. first page is ¡°1¡± ,it may equal NULL

Return Value

Image DPI y-resolution if it is successful; otherwise, it is zero.

              Code = 206 

                     Get pdf files page total.

Para1

Ignore

Para2

Ignore

Para3

Ignore

Para4

Ignore

Return Value

page total if it is successful; otherwise, it is zero.

              Code = 250 

                     Get string width with indicate font and size.

                     Para1

                                   Font name code, see font code table (table one).

                                   Use current font name if para1 equal 0.

                     Para2

                                   Font size.

                                   Use current font size if para2 equal 0.

Para3

Indicate string.

Para4

Ignore

Return Value

String width if it is successful; otherwise, it is zero.

 

long VeryAddInfoEx (very_id id, char * Title, char * Subject, char * Author, char * Keywords, char * Creator)

Description

              Set PDF file information.

Parameters

Id

       Returned by VeryCreateEx or VeryOpenEx function.

              Title             

Set title to PDF file , it may equal NULL.

              Subject

       Set subject to PDF file, it may equal NULL.

              Author             

Set author to PDF file, it may equal NULL.

              Keywords      

Set Keywords to PDF file, it may equal NULL.

              Creator          

Set Creator to PDF file, it may equal NULL.

Return Value

Nonzero if it is successful; otherwise, it is zero.

 

 

 

long VeryAddText2Ex(very_id,long x,long y, char *string,long color)

Description

The VeryAddText2Ex function writes a character string at the specified location, using the currently selected font, text color, if x = y = -1, indicate the text string will be drawing at current text position, default text position is (64, 64).

Parameters

Id

       Returned by VeryCreateEx or VeryOpenEx function.

              x                  

Specifies the logical x-coordinate of the reference point that the system uses to align the string, the x-coordinate will moved automatically.

              y

Specifies the logical y-coordinate of the reference point that the system uses to align the string, the y-coordinate will moved automatically.

              string             

Pointer to the string to be drawn, this string may include ¡°\n¡± symbol

              color      

Set text color, you may use RGB macro to combine this value.

Return Value

Nonzero if it is successful; otherwise, it is zero.

 

long VeryAddText1Ex(very_id,long x,long y, long width,long height, char *string,long color ,long bkcolor, long lFormat)

Description

The VeryAddText1Ex function writes a character string in the specified rectangle , using the currently selected font, text color.

Parameters

Id

       Returned by VeryCreateEx or VeryOpenEx function.

              x                  

Specifies the logical x-coordinate of the reference point that the system uses to align the string, the x-coordinate will moved automatically.

              y

Specifies the logical y-coordinate of the reference point that the system uses to align the string, the y-coordinate will moved automatically.

              width and height

                     Specifies rectangle width and height.

              string             

Pointer to the string to be drawn , this string may include ¡°\n¡± symbol.

              color      

Set text color, you may use RGB macro to combine this value.

              bkcolor  

Set rectangle fill color, you may use RGB macro to combine this value.

If this value equal ¨C1 then no fill color.

              lFormat

Specifies the method of formatting the text. This parameter can be one or more of the following values.

   0:Aligns text to the left.

   1:Centers text horizontally in the rectangle.

   2:Aligns text to the right.

   16(hex:10):Breaks words.

   1024(hex:400):Auto modify the width and height of the rectangle.

Return Value

Nonzero if it is successful; otherwise, it is zero.

 

long VeryAddLineEx(very_id id,long sx,long sy,long ex,long ey,long width,long color)

Description

The VeryAddLineEx function draws a line from the (sx, sy) position up to (ex, ey), using the specified width and color.

Parameters

Id

       Returned by VeryCreateEx or VeryOpenEx function.

              sx          

Start x-coordinate.

              sy

       Start y-coordinate.

              ex

End x-coordinate.

              ey

End y-coordinate.

              width      

Line width in pixel.

              Color

                     Set line color, in RGB format.

Return Value

Nonzero if it is successful; otherwise, it is zero.

 

long VeryAddRectEx(very_id id,long sx,long sy,long ex,long ey, long side_width,long side_color, long flagFill,long fill_color)

Description

              Draw a rectangle.

Parameters

Id

       Returned by VeryCreate or VeryOpen function.

              sx          

Start x-coordinate.

              sy

       Start y-coordinate.

              ex

End x-coordinate.

              ey

End y-coordinate.

              side_width      

Side line width in pixel.

              Side_color

                     Side line color, in RGB format.

              flagFIll

                     Whether fill this rectangle or not.

              fill_color

                     Fill rectangle using specify color, in RGB format.

Return Value

Nonzero if it is successful; otherwise, it is zero.


Home | Products | Downloads | Support | Links | Contact

Copyright © 2000- VeryPDF.com, Inc. All rights reserved.
Send comments about this site to the webmaster.