PC SOFT
DEPOT EN LIGNE
POUR WINDEVWEBDEV ET WINDEV MOBILE

WD Printing by programming - Impressão Programada
Publié par Boller
dans la catégorie Outils
Nouveautés



Description
WD Printing by programming - Impressão Programada

Info("A set of previews will be displayed","Those allow display of the various printing methods using programming")

Str1 is string = "WINDEV is a great tool"
Str2 is string = "Printing is child's play "

iPreview(SELECT-1)

// Create an Helvetica font
iCreateFont(1,12,iNormal,iSwiss)
iCreateFont(2,10,iNormal,iRoman)

// Print the text
iPrint(iFont(1) + Str1 + " - Helvetica 12 Normal")
iPrint(iFont(2) + Str2 + " - Roman 10 Normal")
iEndPrinting

iPreview(SELECT-1)

// Create an Helvetica font
iCreateFont(1,14,iBold, "Times New Roman")
iCreateFont(2,10,iNormal,"Arial")
// Print the text
iPrint(iFont(1) + Str1 + " - Times New Roman 14 Bold")
iPrint(iFont(2) + Str2 + " - Arial 10 Normal")
iEndPrinting

iPreview(SELECT-1)

iCreateFont(1,24,iNormal,"Times New Roman")
iCreateFont(2,12,iBold,"Arial")
iYPos(100)
iXPos(30)
iPrint(iFont(1)+ Str1)
iXPos(30)
iPrint(iFont(2)+Str2)
iEndPrinting

iPreview(SELECT-1)

iCreateFont(1,14,iBold,"Arial")
iCreateFont(2,10,iNormal,"Arial")
iPrintWord(iFont(1)+"WINDEV ")
iPrintWord(iFont(2)+"is a great tool")
iEndPrinting

iPreview(SELECT-1)

iCreateFont(1,14,iBold,"Arial")
iCreateFont(2,10,iNormal,"Arial")
iPrintWord(iFont(1)+"WINDEV ")
iPrintWord(iFont(2)+"is a great tool")
iEndPrinting

iPreview(SELECT-1)

iCreateFont(1,16,iBold,iSwiss)
iFont(1)
iPrint(iXPos(20)+iYPos(50)+"I am the first")
iPrint(iXPos(100)+iYPos(20)+"And I am the second")
iEndPrinting



//---------------------------------------------------------------------------------------------


Str is string = "WINDEV is a great tool"

iPreview(SELECT-1)

// Create an "Arial 8 Normal" font
iCreateFont(1,8,iNormal,"Arial")
// Print the text
iPrint(iFont(1)+Str+" - Arial 8 Normal")
iSkipLine

// Create an "Arial 12 Bold" font
iCreateFont(2,12,iBold,"Arial")
// Print the text
iPrint(iFont(2)+Str+" - Arial 12 Bold")
iSkipLine

// Create a "Times New Roman 14 Bold Italic" font
iCreateFont(3,14,iBold+iItalic,"Times New Roman")
// Prints the underlined text
iPrint(iFont(3)+Str+" - Times New Roman 14 Italic Bold")
iHLine(0,iPageWidth(),8)
Didot is real = 0.3759 // 1 Didot = 1 Point = 0.3759 mm
iYPos(iYPos()+8*Didot) // To position the rest of the text to print
// as iHLine does not move the cursor

// Create a "Times New Roman 14 Italic" font
iCreateFont(4,14,iItalic,"Times New Roman")
// Print the centered text
iXPos(iPageWidth()/2 - ...
iTextWidth(Str+" - Times New Roman 14 Italic")/2)
iPrint(iFont(4)+Str+" - Times New Roman 14 Italic")

// Print the text within a border
iBorder(10,40,90,50,2,10,1) // Border
iXPos(12) // Horizontal position of the following text
iYPos(42) // Vertical position of the following text
iPrint(iFont(3)+Str) // Print

// Print the text within a colored border
iCreateFont(1,16,iBold,iRoman,iDarkBlue)
iCreateFont(2,12,iNormal,iRoman,iBlack)
iBorder(10,60,110,100,2,0,iLightRed)
iXPos(iXPos()+20);iYPos(iYPos()+20)
iPrint(iFont(1)+Str)
iXPos(iXPos()+20)
iPrint(iFont(2)+"Print in color")

// Print a white text on a black background
iCreateFont(1,16,iBold,iRoman,iLightYellow)
iBorder(10,110, 100,130,2,100) // black border
iXPos(15)
iYPos(120)
iPrint(iFont(1)+Str) // white text
iEndPrinting



// Start the print
iEndPrinting


//-----------------------------------------------------------------------------------------------

ImageName is string = "FLOWER2.PCX"

iPreview(SELECT-1)
iCreateFont(1,10,iNormal,"Arial")

// Normal image
iYPos(5)
iPrint(iFont(1)+"Normal image")
iPrintImage(ImageName,1,10)

// Image printed in homothetic(0) mode within the specified border
iYPos(25)
iPrint(iFont(1)+"Image printed in homothetic(0) mode in the specified border")
iBorder(1,30,40,50)
iPrintImage(ImageName,1,30,40,50,0)

// Image centered(999) within a border exceeding its own size
iYPos(55)
iPrint(iFont(1)+"Image centered(999) within a border exceeding its own size")
iBorder(1,60,40,80)
iPrintImage(ImageName,1,60,40,80,999)

// Image printed in stretched mode within the specified border
iYPos(85)
iPrint(iFont(1)+"Image printed in stretched mode within the specified border ")
iBorder(1,90,40,110)
iPrintImage(ImageName,1,90,40,110)

// Image printed in % mode (50%)
iYPos(115)
iPrint(iFont(1)+"Image printed in % mode (50%)")
iPrintImage(ImageName,1,120,50)

// Image printed in % mode (300%)
iYPos(125)
iPrint(iFont(1)+"Image printed in % mode (300%)")
iPrintImage(ImageName,1,130,300)

// Start the print
iEndPrinting


//-----------------------------------------------------------------------------------

BackgroundImage is string = "CHIEF.PCX"

iPreview(SELECT-1)

// Create the fonts
iCreateFont(1,30,iBold,iSwiss)
iCreateFont(2,24,iBold+iUnderlined,iSwiss)
iCreateFont(3,16,iNormal,iSwiss)

// Display the background image in the page
iPrintImage(BackgroundImage,20,5,iPageWidth(),iPageHeight(),0)

// Position of the title
iXPos(80)
iYPos(100)
// iPrint(iFont(1)+"MENU")

// Position of the text
iXPos(90)
iYPos(110)
iPrint(iFont(2)+"Entries")
iXPos(80)
iPrint(iFont(3)+"Eggs Mayonnaise")
iXPos(80)
iPrint(iFont(3)+"Raw Vegetables")
iXPos(80)
iPrint(iFont(3)+"Cold Meats")
iSkipLine

iXPos(95)
iPrint(iFont(2)+"Dishes")
iXPos(80)
iPrint(iFont(3)+"Rabbit with Mustard")
iXPos(80)
iPrint(iFont(3)+"Beef in red wine")
iXPos(80)
iPrint(iFont(3)+"Roast chicken")
iSkipLine

iXPos(85)
iPrint(iFont(2)+"Desserts")
iXPos(80)
iPrint(iFont(3)+"Cottage cheese")
iXPos(80)
iPrint(iFont(3)+"Lemon Pie")
iXPos(80)
iPrint(iFont(3)+"Fresh fruit salad")

// Start the print
iEndPrinting


//--------------------------------------------------------------------

// the form with iConfigure and iParameter
iParameter()


//---------------------------------------------------------------------

// the form with iConfigure and iParameter
iConfigure()
Illustrations, copies d'écran
none
none
Avis des utilisateurs
(Pour noter la ressource, cliquez sur Ecrire un avis)
Aucun avis ou commentaire ? Soyez le premier !