Advertisement
Guest User

Visual Basic 6.0 PDF writer Project

a guest
Oct 18th, 2016
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.97 KB | None | 0 0
  1. Dim textinput As String
  2. ________________________________________________________________
  3. Private Sub Command1_Click()
  4.     ' Create a simple PDF file using the mjwPDF class
  5.     Dim objPDF As New mjwPDF
  6.    
  7.     ' Set the PDF title and filename
  8.     objPDF.PDFTitle = " "
  9.     objPDF.PDFFileName = App.Path & "\NEWFILE.pdf"
  10.    
  11.     ' We must tell the class where the PDF fonts are located
  12.     objPDF.PDFLoadAfm = App.Path & "\Fonts"
  13.     ' inserted code- L2
  14.     ' Set the file properties
  15.     objPDF.PDFSetLayoutMode = LAYOUT_DEFAULT
  16.     objPDF.PDFFormatPage = FORMAT_A4
  17.     objPDF.PDFOrientation = ORIENT_PORTRAIT
  18.     objPDF.PDFSetUnit = UNIT_PT
  19.     'end L2 insert
  20.    
  21.     ' View the PDF file after we create it
  22.     objPDF.PDFView = False
  23.    
  24.     ' Begin our PDF document
  25.     'objPDF.PDFBeginDoc
  26.         ' Set the font name, size, and style
  27.         'objPDF.PDFSetFont FONT_ARIAL, 15, FONT_BOLD
  28.        
  29.         ' Set the text color
  30.         'objPDF.PDFSetTextColor = vbBlue
  31.        
  32.         ' Set the text we want to print
  33.         'objPDF.PDFTextOut _
  34.             "'Hello, World! From mjwPDF (www.vb6.us)"
  35.    
  36.     ' End our PDF document (this will save it to the filename)
  37.     'objPDF.PDFEndDoc
  38.     'Another implementation of the above code
  39. objPDF.PDFSetFont FONT_ARIAL, 15, FONT_BOLD
  40. objPDF.PDFSetDrawColor = vbRed
  41. objPDF.PDFSetTextColor = vbWhite
  42. objPDF.PDFSetAlignement = ALIGN_CENTER
  43. objPDF.PDFSetBorder = BORDER_ALL
  44. objPDF.PDFSetFill = True
  45. objPDF.PDFCell "This Document Was generated by PDF-WRITE V. 1.0 Free Edition.", 15, 15, _
  46.     objPDF.PDFGetPageWidth - 30, 40
  47. 'Customized Code
  48. objPDF.PDFSetFont FONT_TIMES, 12, FONT_NORMAL
  49. objPDF.PDFSetDrawColor = vbWhite
  50. objPDF.PDFSetTextColor = vbBlack
  51. objPDF.PDFSetAlignement = ALIGN_LEFT
  52. objPDF.PDFTextOut _
  53.             "textinput"
  54.    
  55. objPDF.PDFEndDoc
  56. End Sub
  57. _________________________________________________________________________________
  58. Private Sub Text1_Change()
  59. textinput = Text1.Text
  60.  
  61.  
  62. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement