Posted: Fri Jul 04, 2008 1:11 pm
I think so.
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
Procedure dpDuplex(iHandle,iHow)
ProcedureReturn CallFunction(ddoc_libno,"dpDuplex",iHandle,iHow)
EndProcedure
Procedure dpPaperSize(iHandle,sgWidth,sgHeight)
ProcedureReturn CallFunction(ddoc_libno,"dpPaperSize",iHandle,sgWidth,sgHeight)
EndProcedure
Code: Select all
; PureBasic Interface for the ddoc Print and Preview Engine
; Errors returned by dpStartDoc
#DDOC_NOHANDLES = -1
#DDOC_BADFILE = -2
#DDOC_FILEEXISTS = -3
; Status Codes returned by dpMailInit
Enumeration
#DDOC_MAIL_SUCCESS
#DDOC_MAIL_FNF
#DDOC_MAIL_LNF
#DDOC_MAIL_NOH
#DDOC_MAIL_HEIGHT_INVALID
#DDOC_MAIL_WIDTH_INVALID
#DDOC_MAIL_LABHEIGHT_INVALID
#DDOC_MAIL_LABWIDTH_INVALID
#DDOC_MAIL_COL_INVALID
#DDOC_MAIL_ROW_INVALID
#DDOC_MAIL_LINES_INVALID
EndEnumeration
; Unit of measure constants as passed to dpStartDoc
Enumeration
#DDOC_INCH
#DDOC_CM
EndEnumeration
; This can be passed in any of these iOptions parameters in
; dpStartDoc or dpEndDoc:
; Paper / Orientation / Bin
; If passed, then ddoc will respect
; the user's choice of orientation And Bin (Or the system
; defaults if not specified by the user).
#DDOC_SYSTEM_DEFAULT = -1
#DDOC_SAME_AS_FIRST = -2
#DDOC_PAPER_CUSTOM = -3 ; use custom paper size
; Orientation Constants for use with dpStartDoc
Enumeration
#DDOC_PORTRAIT
#DDOC_LANDSCAPE
EndEnumeration
; Paper Bin Constants used in dpStartDoc and dpNewPage
Enumeration 1
#DDOC_BIN_ONLYONE
#DDOC_BIN_LOWER
#DDOC_BIN_MIDDLE
#DDOC_BIN_MANUAL
#DDOC_BIN_ENVELOPE
#DDOC_BIN_ENVMANUAL
#DDOC_BIN_AUTO
#DDOC_BIN_TRACTOR
#DDOC_BIN_SMALLFMT
#DDOC_BIN_LARGEFMT
#DDOC_BIN_LARGECAPACITY
#DDOC_BIN_CASSETTE = 14
EndEnumeration
#DDOC_BIN_LAST = #DDOC_BIN_CASSETTE
#DDOC_BIN_UPPER = #DDOC_BIN_ONLYONE
#DDOC_BIN_FIRST = #DDOC_BIN_ONLYONE
; Paper Size Constants used in dpStartDoc and dpNewPage
Enumeration 1
#DDOC_PAPER_LETTER ; Letter 8 1/2 x 11 in
#DDOC_PAPER_LETTERSMALL ; Letter Small 8 1/2 x 11 in
#DDOC_PAPER_TABLOID ; Tabloid 11 x 17 in
#DDOC_PAPER_LEDGER ; Ledger 17 x 11 in
#DDOC_PAPER_LEGAL ; Legal 8 1/2 x 14 in
#DDOC_PAPER_STATEMENT ; Statement 5 1/2 x 8 1/2 in
#DDOC_PAPER_EXECUTIVE ; Executive"7 1/2 x 10 in
#DDOC_PAPER_A3 ; A3 297 x 420 mm
#DDOC_PAPER_A4 ; A4 210 x 297 mm
#DDOC_PAPER_A4SMALL ; A4 Small 210 x 297 mm
#DDOC_PAPER_A5 ; A5 148 x 210 mm
#DDOC_PAPER_B4 ; B4 250 x 354
#DDOC_PAPER_B5 ; B5 182 x 257 mm
#DDOC_PAPER_FOLIO ; Folio 8 1/2 x 13 in
#DDOC_PAPER_QUARTO ; Quarto 215 x 275 mm
#DDOC_PAPER_10x14 ; 10x14 in
#DDOC_PAPER_11X17 ; 11x17 in
#DDOC_PAPER_NOTE ; Note 8 1/2 x 11 in
#DDOC_ENV_9 ; Envelope #9 3 7/8 x 8 7/8
#DDOC_ENV_10 ; Envelope #10 4 1/8 x 9 1/2
#DDOC_ENV_11 ; Envelope #11 4 1/2 x 10 3/8
#DDOC_ENV_12 ; Envelope #12 4 \276 x 11
#DDOC_ENV_14 ; Envelope #14 5 x 11 1/2
#DDOC_ENV_DL = 27 ; Envelope DL 110 x 220mm
#DDOC_ENV_C5 ; Envelope C5 162 x 229 mm
#DDOC_ENV_C3 ; Envelope C3 324 x 458 mm
#DDOC_ENV_C4 ; Envelope C4 229 x 324 mm
#DDOC_ENV_C6 ; Envelope C6 114 x 162 mm
#DDOC_ENV_C65 ; Envelope C65 114 x 229 mm
#DDOC_ENV_B4 ; Envelope B4 250 x 353 mm
#DDOC_ENV_B5 ; Envelope B5 176 x 250 mm
#DDOC_ENV_B6 ; Envelope B6 176 x 125 mm
#DDOC_ENV_ITALY ; Envelope 110 x 230 mm
#DDOC_ENV_MONARCH ; Envelope Monarch 3.875 x 7.5 in
#DDOC_ENV_PERSONAL ; 6 3/4 Envelope 3 5/8 x 6 1/2 in
#DDOC_FANFOLD_US ; US Std Fanfold 14 7/8 x 11 in
#DDOC_FANFOLD_STD_GERMAN ; German Std Fanfold 8 1/2 x 12 in
#DDOC_FANFOLD_LGL_GERMAN ; German Legal Fanfold 8 1/2 x 13 in
EndEnumeration
; dpStartDoc Option Constants
#DDOC_VIEWBUILD = 1
#DDOC_ALLOWFAX = 2
#DDOC_ALLOWMAPI = 4
#DDOC_ALLOWSAVE = 8
#DDOC_ZOOMWIDTH = 64
#DDOC_ZOOMFIT = 128
#DDOC_ZOOM75 = 256
#DDOC_ZOOM100 = 512
#DDOC_ZOOM125 = 1024
#DDOC_SCALETEXT = 2048
#DDOC_FASTTEXT = 0
#DDOC_SAVE_EXE_ONLY = 4096
#DDOC_ALLOWSMTP = 8192
; Constants For dpDuplex
#DDOC_DUPLEX_HORIZONTAL = 16384
#DDOC_DUPLEX_VERTICAL = 32768
; Font Style Bit-wise constats for the dpFont call
#DDOC_FONTNORMAL = 0
#DDOC_FONTBOLD = 1
#DDOC_FONTITALIC = 2
#DDOC_FONTUNDERLINE = 4
#DDOC_FONTSTRIKEOUT = 8
#DDOC_FONTBASELINE = 16
; dpEndDoc Option constants
#DDOC_END_VIEW = 0
#DDOC_END_PRINT = 1
#DDOC_END_CLOSE = 2
#DDOC_END_DELETE = 4
#DDOC_END_PRINT_NODIALOG = 8
#DDOC_END_FAX = 16
#DDOC_END_EMAIL = 32
#DDOC_END_SPECIFIC_PRINTER = 64
#DDOC_END_CREATE_EXE = 128
; Text alignment constants for dpText, dpPageNo, dpPageCount
Enumeration
#DDOC_LEFT
#DDOC_CENTER
#DDOC_RIGHT
#DDOC_DECIMAL
EndEnumeration
; Error codes for dpSelfExtract
#DDOC_INPUT_NOT_FOUND = -5
#DDOC_OUTPUT_EXISTS = -4
#DDOC_ERR_OPEN_INPUT = -3
#DDOC_ERROR_OPEN_OUTPUT = -2
#DDOC_ERROR_OPEN_STUB = -1
#DDOC_SUCCESS = 0
; Button codes to Assign hints (captions) to buttons
; these will normally be used only by International users
; to replace the English INTs on the screen. Used by
; the dpCaption function
Enumeration
#DDOC_INIT_WORDS ; Initialization flag
#DDOC_MENU_FILE ; File Menu
#DDOC_MENU_DOC ; Document Menu
#DDOC_BTN_EXIT ; Exit button hint and exit menu
#DDOC_BTN_FIRST ; First Button hint and menu
#DDOC_BTN_PREV ; Previous Button hint and menu
#DDOC_BTN_NEXT ; Next button hint and menu
#DDOC_BTN_LAST ; Last Button hint and menu
#DDOC_BTN_JUMP ; Jump Button hint and menu
#DDOC_BTN_PRINT ; Print hint and menu
#DDOC_WORD_ZOOM ; Zoom label caption
#DDOC_WORD_ZOOMFIT ; Zoom Fit INT in drop down
#DDOC_WORD_ZOOMWIDTH ; Zoom Width in drop down
#DDOC_WORD_DOCINDEX ; INT Document index
#DDOC_WORD_PAGE ; Page
#DDOC_WORD_OF ; of
#DDOC_DLG_JUMP_TITLE ; jump dialog title
#DDOC_DLG_JUMP_TEXT ; dialog jump text
#DDOC_BTN_CANCEL ; cancel button
#DDOC_BTN_OK ; ok button
#DDOC_DLG_PW_TITLE ; passINT box title
#DDOC_DLG_PW_TEXT ; passINT text in dialog
#DDOC_DLG_PW_INVALID ; passINT is invalid (try again)
#DDOC_DLG_PW_CANCEL ; passINT invalid (3 strikes and you:'re out)
#DDOC_BTN_EMAIL ; email button
#DDOC_BTN_FAX ; fax button
#DDOC_BTN_SAVE ; save button
EndEnumeration
Global ddoc
; Prototypes
; Document generation
Prototype.l dpProtoStartDoc(hParent,zTitle$,zFile$,iUOM,iPaper,iOrient,iBin,iOptions)
Prototype.l dpProtoNewPage(iHandle,iPaper,iOrient,iBin)
Prototype.l dpProtoBookmark(iHandle,zBookmark$)
Prototype.l dpProtoEndDoc(iHandle,iOptions)
Prototype.l dpProtoEndDocInst()
Prototype.l dpProtoGetFileName(iHandle,zDoc$,iLen)
Prototype.l dpProtoChangeWords(iHandle,iWhich,zText$)
Prototype.l dpProtoSelfExtract(zInputFile$,zDDOC$,zOutEXE$)
Prototype.l dpProtoCheckAbort(iHandle)
Prototype.l dpProtoSetProgress(iHandle,iProgress)
Prototype.l dpProtoSetTabs(iHandle,zTabStops$)
Prototype.l dpProtoTabText(iHandle,y.f,zText$)
; Document Options
Prototype.l dpProtoSetPassword(iHandle,zPassword$)
Prototype.l dpProtoSetScreenOptions(iHandle,x,y,x2,y2,iMaximize)
Prototype.l dpProtoSetAttachExt(iHandle,zExt$)
Prototype.l dpProtoSetEMailOptions(iHandle,zLogon$,zPassword$,zNames$,zAddress$,zSubject$,zNote$,iShowDialog,iMailSelfExtract)
Prototype.l dpProtoSetFaxOptions(iHandle,zLogon$,zPassword$,zRecip$,zSubject$,zNote$,iShowDialog)
Prototype.l dpProtoSMTPOptions(hParent)
Prototype.l dpProtoDuplex(iHandle,iHow)
Prototype.l dpProtoPaperSize(iHandle,sgWidth,sgHeight)
; Font and Text Functions
Prototype.l dpProtoFont(iHandle,iStyle,Size.f,iColor,zFontName$)
Prototype.l dpProtoText(iHandle,x.f,y.f,iAlign,zText$)
Prototype.l dpProtoSpecialText(iHandle,x.f,y.f,iAlign,zText$)
Prototype.l dpProtoFontSpacing(iHandle,dblPoints)
Prototype.l dpProtoWrapText(iHandle,x.f,y.f,x2.f,y2.f,leading.f,zText$)
Prototype.l dpProtoWrapContinue(iHandle,x.f,y.f,x2.f,y2.f,leading.f)
Prototype.l dpProtoWrapCount(iHandle)
Prototype.l dpProtoAngleText(iHandle,x.f,y.f,iAngle,zText$)
Prototype.l dpProtoClipText(iHandle,x.f,y.f,w,iAlign,zText$)
Prototype.l dpProtoPageOffset(iHandle,iOffset)
Prototype.l dpProtoPageNo(iHandle,x.f,y.f,iAlign,iAngle)
Prototype.l dpProtoPageCount(iHandle,x.f,y.f,iAlign,iAngle)
Prototype.f dpProtoTextWidth(iHandle.l,Asciiz$)
; Lines and Graphics
Prototype.l dpProtoLine(iHandle,x.f,y.f,x2.f,y2.f,w.f,c)
Prototype.l dpProtoArc(iHandle,x.f,y.f,x2.f,y2.f,aStart.f,aEnd.f,w.f,iColor)
Prototype.l dpProtoPie(iHandle,x.f,y.f,x2.f,y2.f,aStart.f,aEnd.f,w.f,ilineColor,ifillColor)
Prototype.l dpProtoRect(iHandle,x.f,y.f,x2.f,y2.f,w.f,iFillColor,iBorderColor)
Prototype.l dpProtoEllipse(iHandle,x.f,y.f,x2.f,y2.f,w.f,iFillColor,iBorderColor)
Prototype.l dpProtoRoundRect(iHandle,x.f,y.f,x2.f,y2.f,roundW.f,roundH.f,w.f,iColor,iBorderColor)
Prototype.l dpProtoGraphic(iHandle,x.f,y.f,x2.f,y2.f,zFileName$)
Prototype.l dpProtoEmbedGraphic(iHandle,x.f,y.f,x2.f,y2.f,zFileName$)
Prototype.l dpProtoAddGraphic(iHandle,zFile$)
Prototype.l dpProtoDrawGraphic(iHandle,hBitmap,x.f,y.f,x2.f,y2.f)
Prototype.l dpProtoStretchMode(iHandle,iStretch)
; Printer Handling
Prototype.l dpProtoPrinterCount()
Prototype.s dpProtoGetPrinter(iWhich)
Prototype.l dpProtoIsPrinter(zPrinter$)
Prototype.l dpProtoSpecifyPrinter(iWhich,zPrinter$)
Prototype.l dpProtoPrinterCopies(iWhich,iCopies)
; Mailing Label API
Prototype.l dpProtoMailInit(iHandle,szIniFile$,szIniSection$,nAlign)
Prototype.l dpProtoLabelLines(iHandle)
Prototype.l dpProtoLabelsPerPage(iHandle)
Prototype.l dpProtoLabelText(iHandle,szLabelLine$)
Prototype.l dpProtoNextLabel(iHandle)
Prototype.l dpProtoSetLabelLine(iHandle,nLabelLine)
Prototype.l dpProtoSetLabel(iHandle,nLabelNumber)
Prototype.l dpProtoPrintTemplate(iHandle,LabAlign)
Prototype.f dpProtoLabelX(iHandle)
Prototype.f dpProtoLabelY(iHandle)
; Document generation
Global dpStartDoc.dpProtoStartDoc
Global dpNewPage.dpProtoNewPage
Global dpBookmark.dpProtoBookmark
Global dpEndDoc.dpProtoEndDoc
Global dpEndDocInst.dpProtoEndDocInst
Global dpGetFileName.dpProtoGetFileName
Global dpChangeWords.dpProtoChangeWords
Global dpSelfExtract.dpProtoSelfExtract
Global dpCheckAbort.dpProtoCheckAbort
Global dpSetProgress.dpProtoSetProgress
Global dpSetTabs.dpProtoSetTabs
Global dpTabText.dpProtoTabText
; Document Options
Global dpSetPassword.dpProtoSetPassword
Global dpSetScreenOptions.dpProtoSetScreenOptions
Global dpSetAttachExt.dpProtoSetAttachExt
Global dpSetEMailOptions.dpProtoSetEMailOptions
Global dpSetFaxOptions.dpProtoSetFaxOptions
Global dpSMTPOptions.dpProtoSMTPOptions
Global dpDuplex.dpProtoDuplex
Global dpPaperSize.dpProtoPaperSize
; Font and Text Functions
Global dpFont.dpProtoFont
Global dpText.dpProtoText
Global dpSpecialText.dpProtoSpecialText
Global dpFontSpacing.dpProtoFontSpacing
Global dpWrapText.dpProtoWrapText
Global dpWrapContinue.dpProtoWrapContinue
Global dpWrapCount.dpProtoWrapCount
Global dpAngleText.dpProtoAngleText
Global dpClipText.dpProtoClipText
Global dpPageOffset.dpProtoPageOffset
Global dpPageNo.dpProtoPageNo
Global dpPageCount.dpProtoPageCount
Global dpTextWidth.dpProtoTextWidth
; Lines and Graphics
Global dpLine.dpProtoLine
Global dpArc.dpProtoArc
Global dpPie.dpProtoPie
Global dpRect.dpProtoRect
Global dpEllipse.dpProtoEllipse
Global dpRoundRect.dpProtoRoundRect
Global dpGraphic.dpProtoGraphic
Global dpEmbedGraphic.dpProtoEmbedGraphic
Global dpAddGraphic.dpProtoAddGraphic
Global dpDrawGraphic.dpProtoDrawGraphic
Global dpStretchMode.dpProtoStretchMode
; Printer Handling
Global dpPrinterCount.dpProtoPrinterCount
Global dpGetPrinter.dpProtoGetPrinter
Global dpIsPrinter.dpProtoIsPrinter
Global dpSpecifyPrinter.dpProtoSpecifyPrinter
Global dpPrinterCopies.dpProtoPrinterCopies
; Mailing Label API
Global dpMailInit.dpProtoMailInit
Global dpLabelLines.dpProtoLabelLines
Global dpLabelsPerPage.dpProtoLabelsPerPage
Global dpLabelText.dpProtoLabelText
Global dpNextLabel.dpProtoNextLabel
Global dpSetLabelLine.dpProtoSetLabelLine
Global dpSetLabel.dpProtoSetLabel
Global dpPrintTemplate.dpProtoPrintTemplate
Global dpLabelX.dpProtoLabelX
Global dpLabelY.dpProtoLabelY
Procedure StartDDoc(string$="ddoc32.dll")
ddoc=OpenLibrary(#PB_Any,string$)
If ddoc
dpTextWidth=GetFunction(ddoc,"dpTextWidth")
; Document generation
dpStartDoc=GetFunction(ddoc,"dpStartDoc")
dpNewPage=GetFunction(ddoc,"dpNewPage")
dpBookmark=GetFunction(ddoc,"dpBookmark")
dpEndDoc=GetFunction(ddoc,"dpEndDoc")
dpEndDocInst=GetFunction(ddoc,"dpEndDocInst")
dpGetFileName=GetFunction(ddoc,"dpGetFileNamr")
dpChangeWords=GetFunction(ddoc,"dpChangeWords")
dpSelfExtract=GetFunction(ddoc,"dpSelfExtract")
dpCheckAbort=GetFunction(ddoc,"dpCheckAbort")
dpSetProgress=GetFunction(ddoc,"dpSetProgress")
dpSetTabs=GetFunction(ddoc,"dpSetTabs")
dpTabText=GetFunction(ddoc,"dpTabText")
; Document Options
dpSetPassword=GetFunction(ddoc,"dpSetPassword")
dpSetScreenOptions=GetFunction(ddoc,"dpSetScreenOptions")
dpSetAttachExt=GetFunction(ddoc,"dpSetAttachExt")
dpSetEMailOptions=GetFunction(ddoc,"dpSetEMailOptions")
dpSetFaxOptions=GetFunction(ddoc,"dpSetFaxOptions")
dpSMTPOptions=GetFunction(ddoc,"dpSMTPOptions")
dpDuplex=GetFunction(ddoc,"dpDuplex")
dpPaperSize=GetFunction(ddoc,"dpPaperSize")
; Font and Text Functions
dpFont=GetFunction(ddoc,"dpFont")
dpText=GetFunction(ddoc,"dpText")
dpSpecialText=GetFunction(ddoc,"dpSpecialText")
dpFontSpacing=GetFunction(ddoc,"dpFontSpacing")
dpWrapText=GetFunction(ddoc,"dpWrapText")
dpWrapContinue=GetFunction(ddoc,"dpWrapContinue")
dpWrapCount=GetFunction(ddoc,"dpWrapCount")
dpAngleText=GetFunction(ddoc,"dpAngleText")
dpClipText=GetFunction(ddoc,"dpClipText")
dpPageOffset=GetFunction(ddoc,"dpPageOffset")
dpPageNo=GetFunction(ddoc,"dpPageNo")
dpPageCount=GetFunction(ddoc,"dpPageCount")
dpTextWidth=GetFunction(ddoc,"dpTextWidth")
; Lines and Graphics
dpLine=GetFunction(ddoc,"dpLine")
dpArc=GetFunction(ddoc,"dpArc")
dpPie=GetFunction(ddoc,"dpPie")
dpRect=GetFunction(ddoc,"dpRect")
dpEllipse=GetFunction(ddoc,"dpEllipse")
dpRoundRect=GetFunction(ddoc,"dpRoundRect")
dpGraphic=GetFunction(ddoc,"dpGraphic")
dpEmbedGraphic=GetFunction(ddoc,"dpEmbedGraphic")
dpAddGraphic=GetFunction(ddoc,"dpAddGraphic")
dpDrawGraphic=GetFunction(ddoc,"dpDrawGraphic")
dpStretchMode=GetFunction(ddoc,"dpStretchMode")
; Printer Handling
dpPrinterCount=GetFunction(ddoc,"dpPrinterCount")
dpGetPrinter=GetFunction(ddoc,"dpGetPrinter")
dpIsPrinter=GetFunction(ddoc,"dpIsPrinter")
dpSpecifyPrinter=GetFunction(ddoc,"dpSpecifyPrinter")
dpPrinterCopies=GetFunction(ddoc,"dpPrinterCopies")
; Mailing Label API
dpMailInit=GetFunction(ddoc,"dpMailInit")
dpLabelLines=GetFunction(ddoc,"dpLabelLines")
dpLabelsPerPage=GetFunction(ddoc,"dpLabelsPerPage")
dpLabelText=GetFunction(ddoc,"dpLabelText")
dpNextLabel=GetFunction(ddoc,"dpNextLabel")
dpSetLabelLine=GetFunction(ddoc,"dpSetLabelLine")
dpSetLabel=GetFunction(ddoc,"dpSetLabel")
dpPrintTemplate=GetFunction(ddoc,"dpPrintTemplate")
dpLabelX=GetFunction(ddoc,"dpLabelX")
dpLabelY=GetFunction(ddoc,"dpLabelY")
EndIf
ProcedureReturn ddoc
EndProcedure
Procedure StopDDoc(ddoc)
If ddoc
CloseLibrary(ddoc)
ddoc=0
EndIf
EndProcedure
I haven't really had a problems with it - great product, great price! (you also get the entire source when you buy).Have you been satisfied with the ease of use, updates and support?