BitsAndBytes Active Member Licensed User Apr 3, 2018 #1 I have 22 lines of text and i want to create a pdf file with 3 pages and print lines them so each page can have 10 lines and the last page will have 2 remain lines can you help? Thanks Private pdfDoc As PdfDocument pdfDoc.Initialize totalLines = 22 linesPerPage = 10 totalPagesToCreate = 3 intSpacing = 30 First line must have 10 lines Second must have 10 lines and the last page 2 remain lines Code: For i = 0 To totalPagesToCreate - 1 pdfDoc.StartPage(595, 842) pdfDoc.Canvas.DrawText("New line of text", 40, (i * intSpacing) + 20, Typeface.SANS_SERIF, 14 / GetDeviceLayoutValues.Scale , Colors.Black, "LEFT") pdfDoc.FinishPage End If
I have 22 lines of text and i want to create a pdf file with 3 pages and print lines them so each page can have 10 lines and the last page will have 2 remain lines can you help? Thanks Private pdfDoc As PdfDocument pdfDoc.Initialize totalLines = 22 linesPerPage = 10 totalPagesToCreate = 3 intSpacing = 30 First line must have 10 lines Second must have 10 lines and the last page 2 remain lines Code: For i = 0 To totalPagesToCreate - 1 pdfDoc.StartPage(595, 842) pdfDoc.Canvas.DrawText("New line of text", 40, (i * intSpacing) + 20, Typeface.SANS_SERIF, 14 / GetDeviceLayoutValues.Scale , Colors.Black, "LEFT") pdfDoc.FinishPage End If
DonManfred Expert Licensed User Longtime User Apr 3, 2018 #2 Do what you said you want to do. It does not work if you just iterate through ALL and you create a new pdf page for each iteration/each line). Upvote 0
Do what you said you want to do. It does not work if you just iterate through ALL and you create a new pdf page for each iteration/each line).
BitsAndBytes Active Member Licensed User Apr 3, 2018 #3 I dont know how to make some kind of paginations with the lines Upvote 0
KMatle Expert Licensed User Longtime User Apr 3, 2018 #4 Write the code like you "think" Code: For P=1 To NumberOfPages CreatePage Next Sub CreatePage Dim yPos as Int = 0 pdfDoc.StartPage(595, 842) For L=1 To NumberOFLines GetTheLine PrintIt at yPos Add Spacing to yPos Next pdfDoc.FinishPage End Sub Upvote 0
Write the code like you "think" Code: For P=1 To NumberOfPages CreatePage Next Sub CreatePage Dim yPos as Int = 0 pdfDoc.StartPage(595, 842) For L=1 To NumberOFLines GetTheLine PrintIt at yPos Add Spacing to yPos Next pdfDoc.FinishPage End Sub
BitsAndBytes Active Member Licensed User Apr 3, 2018 #5 My problem is that i want to print in first page the line 1 and line 2 and in second page the line 3 and line 4 . I dont want to print all lines in every page Thanks Last edited: Apr 3, 2018 Upvote 0
My problem is that i want to print in first page the line 1 and line 2 and in second page the line 3 and line 4 . I dont want to print all lines in every page Thanks