i'm working opn a project now the bigest problem of them all is the printdocument 
i use this script in my printdocument1
Code Block
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
With e.Graphics
.DrawString( "BOUWKUNDIG RAPPORT NATIONALE HYPOTHEEK GARANTI", New Font("arial", 14, FontStyle.Bold), Brushes.Black, 40, 80)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 100)
.DrawString( "Inleiding ", New Font("arial", 10, FontStyle.Bold), Brushes.Black, 40, 120)
.DrawString( "Bij de aanvraag voor Nationale Hypotheek Garantie moet in een aantal gevallen een bouwkundig rapport worden", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 140)
.DrawString( "opgemaakt. Indien het rapport wordt opgemaakt door de gemeente of door de 'vereniging eigen huis' gelden ten", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 160)
.DrawString( "aanzien van het bouwkundig rapport geen vormvoorschriften. In alle overige gevallen dient het rapport te worden", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 180)
.DrawString( "opgemaakt overeenkomstig het Model Bouwkundig Rapport Nationale Hypotheek Garantie. Het staat bouwkundige", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 200)
.DrawString( "bedrijven uiteraard vrij een eigen (mogelijk uitgebreider) bouwkundig rapport aan de klant te overleggen. In dat geval", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 220)
.DrawString( "dienen de voor de aanvraag van Nationale Hypotheek Garantie van belang zijnde gegevens te worden samengevat in het", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 240)
.DrawString( "Bouwkundig Rapport Nationale Hypotheek Garantie .", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 260)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 280)
.DrawString( "Toetsingskader voor de keuring", New Font("arial", 10, FontStyle.Bold), Brushes.Black, 40, 300)
.DrawString( "In het rapport zijn de bouwtechnisch belangrijke bouwdelen aangegeven in een checklist. Deze bouwdelen worden in ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 320)
.DrawString( "ieder geval geïnspecteerd, omdat gebreken aan deze onderdelen kostbaar kunnen zijn. Aan de hand van de checklist ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 340)
.DrawString( "wordt per bouwdeel aangegeven op welke kosten gerekend moet worden om de gebreken op te heffen. Grote kosten-", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 360)
.DrawString( "posten die zich in andere bouwdelen voordoen, moeten worden verantwoord onder 'diversen', evenals gebreken aan niet ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 380)
.DrawString( "nader benoemde bouwdelen die van invloed zijn op veiligheid, gezond heid en gebruik. Het toetsingskader voor de ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 400)
.DrawString( "keuring is vastgelegd in het programma van eisen en aanbevelingen van het Bouwkundig Rapport Nationale Hypotheek ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 420)
.DrawString( "Garantie. Bij de inspectie worden alleen de zichtbare bouwdelen gecontroleerd. Op deze manier is het niet mogelijk om ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 440)
.DrawString( "een oordeel te geven over bijvoorbeeld fundering, riolering, etc. Als de inspecteur aanvullend specialistisch onderzoek ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 460)
.DrawString( "nodig vindt, dan dient dat in het rapport te worden vermeld (opmerkingen).", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 480)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 500)
.DrawString( "Kostenindicaties", New Font("arial", 10, FontStyle.Bold), Brushes.Black, 40, 520)
.DrawString( "�De kostenindicaties kunnen betrekking hebben op: ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 540)
.DrawString( "- direct noodzakelijke kosten: kosten van het direct noodzakelijke herstel van gebreken;", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 65, 560)
.DrawString( "- kosten op termijn: kosten van toekomstig onderhoud (naar keuze binnen 5, 10 of 15 jaar) op basis van een bij het ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 65, 580)
.DrawString( "rapport te voegen onderhoudsplan; ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 70, 600)
.DrawString( "- kosten voor verbetering: kosten van verbetering op basis van een bij het rapport te voegen verbeterplan dan wel ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 65, 620)
.DrawString( "een offerte ter zake.", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 70, 640)
.DrawString( "�De kostenindicaties worden: ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 660)
.DrawString( "- afzonderlijk vermeld (direct noodzakelijk; op termijn noodzak elijk; verbetering); ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 65, 680)
.DrawString( "- gebaseerd op aannemersprijzen (geen doe-het -zelf -werk-zaamheden); ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 65, 700)
.DrawString( "- vermeld inclusief BTW; ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 65, 720)
.DrawString( "- indien mogelijk en economisch verantwoord, geraamd op basis van herstel en niet op basis van complete ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 65, 740)
.DrawString( "vervanging;", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 70, 760)
.DrawString( "- vastgesteld ervan uitgaande dat de aannemer achter elkaar kan doorwerken; ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 65, 780)
.DrawString( "�De kosten van stut- , sloop -, en steigerwerk en de kosten van vervolgschade worden niet in de kostenindicaties ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 800)
.DrawString( "opgenomen.", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 65, 820)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 840)
.DrawString( "Fiscale aspecten ", New Font("arial", 10, FontStyle.Bold), Brushes.Black, 40, 860)
.DrawString( "Indien de keuring is uitgevoerd om te voldoen aan de voorwaarden en normen van de Nationale Hypotheek Garantie en ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 880)
.DrawString( "de hypothecaire lening is verstrekt met Nationale Hypotheek Garantie, dan zijn de kosten van deze keuring, evenals de ", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 900)
.DrawString( "kosten voor het verkrijgen van de Nationale Hypotheek Garantie, aftrekbaar voor de inkomstenbelasting.", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 920)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 940)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 960)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 980)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 1000)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 1020)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 1040)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 1060)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 1080)
.DrawString( "", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 1100)
End With
End Sub
the code is fine but the problem now actuely is that i need 24 more pages like this but whit diferent tekst en even picturs and such but thats not the hardest problem for me even let it print is easy but big problem is when ik kom on
.DrawString("", New Font("arial", 10, FontStyle.Regular), Brushes.Black, 40, 1200)
or something like that its not showing a new page or what ever its my idea that it makes a new page whit the new 30 to 60 lines
i tryed e.hasmorepages but that dosn't work ofc then i do get more pages like 100 not the thing i want
i hope some one can help me whit this
killer.
| | killerbeam Monday, October 15, 2007 5:47 PM | You have to keep track of the position on the page and ask for a new page (e.HasMorePages = True) when you exceed the height of a page. You then have to draw on the next page. That means you have to bypass what you have already printed. | | JohnWein Monday, October 15, 2007 9:57 PM | killerbeam,
According to your question on printing on more new pages and PrintPageEventArgs.HasMorePages property, I would like to provide you the suggestions as follows:
1. HasMorePages Property gets or sets a value indicating whether an additional page should be printed. When the property value is true, it means there is an additional page should be printed. The default value is false.
The following code snippet shows you an example on the property:
Code Block
' Specifies what happens when the PrintPage event is raised.
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
' Draw a picture.
ev.Graphics.DrawImage(Image.FromFile("C:\My Folder\MyFile.bmp"), _
ev.Graphics.VisibleClipBounds)
' Indicate that this is the last page to print.
ev.HasMorePages = False
End Sub
For further information on the property, please take a look at the following link:
http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printpageeventargs.hasmorepages(VS.71).aspx
2. I would like to provide you an example. This example shows how to print a long series of paragraphs in different fonts, breaking across pages in VB .NET. It shows measure text to see where it needs to brak across pages, and how to tell VB not to draw partial words or lines.
Print and display print previews in VB .NET
Hope that can help you. | | Bruno Yu Thursday, October 18, 2007 10:51 AM | You have to keep track of the position on the page and ask for a new page (e.HasMorePages = True) when you exceed the height of a page. You then have to draw on the next page. That means you have to bypass what you have already printed. | | JohnWein Monday, October 15, 2007 9:57 PM |
| JohnWein wrote: |
|
You have to keep track of the position on the page and ask for a new page (e.HasMorePages = True) when you exceed the height of a page. You then have to draw on the next page. That means you have to bypass what you have already printed.
| |
okey how can i do this actuely ? | | killerbeam Monday, October 15, 2007 9:59 PM | killerbeam,
According to your question on printing on more new pages and PrintPageEventArgs.HasMorePages property, I would like to provide you the suggestions as follows:
1. HasMorePages Property gets or sets a value indicating whether an additional page should be printed. When the property value is true, it means there is an additional page should be printed. The default value is false.
The following code snippet shows you an example on the property:
Code Block
' Specifies what happens when the PrintPage event is raised.
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
' Draw a picture.
ev.Graphics.DrawImage(Image.FromFile("C:\My Folder\MyFile.bmp"), _
ev.Graphics.VisibleClipBounds)
' Indicate that this is the last page to print.
ev.HasMorePages = False
End Sub
For further information on the property, please take a look at the following link:
http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printpageeventargs.hasmorepages(VS.71).aspx
2. I would like to provide you an example. This example shows how to print a long series of paragraphs in different fonts, breaking across pages in VB .NET. It shows measure text to see where it needs to brak across pages, and how to tell VB not to draw partial words or lines.
Print and display print previews in VB .NET
Hope that can help you. | | Bruno Yu Thursday, October 18, 2007 10:51 AM |
|