PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 30, 2024 8:20 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jan 22, 2015 10:06 am 
Offline

Joined: Thu Jan 22, 2015 9:51 am
Posts: 1
Hi,

I could create a pdf doc from the below code but the issue text wrapping even though there no space

for ex..take a sentance.. "PDF Sharp is used to create pdfdocument"...here in this sentance pdfdocument is displaying in 2 lines..intead i want total 'pdfdocument' word to display in next line.

Please help me out on this.

Code:
Private Sub PYO_PDF(ByVal PDF_DATA As DataSet, ByVal DATA As DATA, ByVal DRAWER As CONTENT, ByVal printSortFirst As Boolean, ByVal printSortThen As Boolean)
        ' MHE1: Define variables
        Dim PDF As New PdfDocument
        Dim PDF_DRAW As XGraphics

        ' MHE1: False for GSSSpares
        ' MHE1: True for KONESpares
        Dim KONESpares As Boolean = False

        ' MHE1: PDF Material page count start
        DRAWER.SET_TEXT_PAGE = 1

        ' MHE1: PDF document version
        PDF.Version = "14"
        ' MHE1: PDF colormode
        PDF.Options.ColorMode = PdfColorMode.Cmyk

        ' MHE1: Colorprofile used in PDF

        Dim profilePath As String = resourcePathLocal & "\PYO5Resources\ISOcoated_v2_300_eci.icc"
        INSERT_COLORPROFILE(PDF, profilePath)

        ' MHE1: Fonts used in PDF
        DRAWER.SET_FONT_TITLE_TEXT = New XFont("Helvetica", "14", XFontStyle.Bold, New XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always))
        DRAWER.SET_FONT_HEAD_TEXT = New XFont("Helvetica", "12", XFontStyle.Bold, New XPdfFontOptions(PdfFontEmbedding.Always))
        DRAWER.SET_FONT_SMALL_TEXT = New XFont("Helvetica", "8", XFontStyle.Bold, New XPdfFontOptions(PdfFontEmbedding.Always))
        If DATA.SET_DESCRIPTION_1ST.ToUpper = "ZH" Or DATA.SET_DESCRIPTION_2ND.ToUpper = "ZH" Or DATA.SET_DESCRIPTION_3RD.ToUpper = "ZH" Then
            DRAWER.SET_FONT_NORMAL_TEXT = New XFont("Arial Unicode MS", "8", XFontStyle.Regular, New XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always))
        Else
            DRAWER.SET_FONT_NORMAL_TEXT = New XFont("Verdana", "8", XFontStyle.Regular, New XPdfFontOptions(PdfFontEmbedding.Always))
        End If
        DRAWER.SET_FONT_BOLD_TEXT = New XFont("Verdana", "8", XFontStyle.Bold, New XPdfFontOptions(PdfFontEmbedding.Always))

        DRAWER.SET_FONT_INFO_TEXT = New XFont("Helvetica", "10", XFontStyle.Bold, New XPdfFontOptions(PdfFontEmbedding.Always))
        DRAWER.SET_FONT_VERYSMALL_TEXT = New XFont("Helvetica", "6", XFontStyle.Regular, New XPdfFontOptions(PdfFontEmbedding.Always))

        ' MHE1: Drawing components
        Dim TEXT_BRUSH As New XSolidBrush(DRAWER.SET_COLOR_FONTGROUND)
        Dim LINE_PEN As New XPen(DRAWER.SET_COLOR_LINEGROUND)

        ' MHE1: Draw front cover
        INSERT_FRONTCOVER(PDF, DRAWER, KONESpares)

        ' MHE1: Material pageside
        Dim pageside As Boolean = True
        ' MHE1: Content pageside
        Dim contentpageside As Boolean = True
        ' MHE1: Contents
        Dim content As String = ""

        If (PDF_DATA.Tables(0).Rows.Count - 1) > 0 Then
            ' MHE1: Draw first material page
            PDF_DRAW = INSERT_MATERIAL_PAGE(PDF, DRAWER, pageside, PDF_DATA.Tables(0).Rows(0).Item(DATA.SET_SORT_1ST).ToString)
            If XUnit.FromPoint(PDF_DRAW.MeasureString(PDF_DATA.Tables(0).Rows(0).Item(DATA.SET_SORT_1ST).ToString, DRAWER.SET_FONT_SMALL_TEXT).Width).Millimeter > XUnit.FromMillimeter(100).Millimeter Then
                Dim string_temp As String = ""
                Dim string_full As String = ""
                Dim string_start As Integer = 0
                Dim string_end As Integer = 1
                While string_temp = ""
                    While XUnit.FromPoint(PDF_DRAW.MeasureString(string_temp, DRAWER.SET_FONT_SMALL_TEXT).Width).Millimeter < XUnit.FromMillimeter(100).Millimeter
                        Try
                            string_temp = PDF_DATA.Tables(0).Rows(0).Item(DATA.SET_SORT_1ST).ToString.Substring(string_start, string_end)
                            string_end = string_end + 1
                        Catch ex As Exception
                            Exit While
                        End Try
                    End While
                    string_full = string_full & string_temp
                    If string_full.Length >= PDF_DATA.Tables(0).Rows(0).Item(DATA.SET_SORT_1ST).ToString.Length Then
                        content = content & "?" & string_temp.Trim()
                        Exit While
                    Else
                        content = content & "?" & string_temp.Trim() & "&" & DRAWER.SET_TEXT_PAGE - 1
                        string_start = string_start + string_end - 1
                        string_end = 1
                        string_temp = ""
                    End If
                End While
            Else
                content = content & "?" & SPLIT_MEASURE_STRING(PDF_DRAW, PDF_DATA.Tables(0).Rows(0).Item(DATA.SET_SORT_1ST).ToString, 105, DRAWER.SET_FONT_SMALL_TEXT) & "&" & DRAWER.SET_TEXT_PAGE - 1
            End If
            ' MHE1: Run through the materials

            ' MHE1: ??
            'Dim aa As AliasAccount
            'aa = New AliasAccount(imageFolderUser, imageLocationPassword, "KONENET")
            'aa.BeginImpersonation()


            ' checkin
            For material_i As Long = 0 To (PDF_DATA.Tables(0).Rows.Count - 1)
                ' MHE1: Start with text printing
                Dim TABLE_OF_STRINGS(0 To 40) As String
                Dim string_i As Integer = 0
                For column_i As Integer = 0 To (PDF_DATA.Tables(0).Columns.Count - 1)
                    If PDF_DATA.Tables(0).Rows(material_i).Item(column_i).ToString = "" Then
                        TABLE_OF_STRINGS(string_i) = " "
                        string_i = string_i + 1
                    ElseIf PDF_DATA.Tables(0).Columns(column_i).ColumnName = "PART IMAGE" Then
                        string_i = string_i + 1
                    ElseIf PDF_DATA.Tables(0).Columns(column_i).ColumnName = DATA.SET_SORT_1ST And printSortFirst = False Then
                        string_i = string_i + 1
                    ElseIf PDF_DATA.Tables(0).Columns(column_i).ColumnName = DATA.SET_SORT_2ND And printSortThen = False Then
                        string_i = string_i + 1
                    ElseIf XUnit.FromPoint(PDF_DRAW.MeasureString(PDF_DATA.Tables(0).Rows(material_i).Item(column_i).ToString, DRAWER.SET_FONT_NORMAL_TEXT).Width).Millimeter > XUnit.FromMillimeter(80).Millimeter Then
                        Dim string_temp As String = ""
                        Dim string_full As String = ""
                        Dim string_start As Integer = 0
                        Dim string_end As Integer = 1
                        While string_temp = ""
                            While XUnit.FromPoint(PDF_DRAW.MeasureString(string_temp, DRAWER.SET_FONT_NORMAL_TEXT).Width).Millimeter < XUnit.FromMillimeter(80).Millimeter
                                Try
                                    string_temp = PDF_DATA.Tables(0).Rows(material_i).Item(column_i).ToString.Substring(string_start, string_end)
                                    string_end = string_end + 1
                                Catch ex As Exception
                                    Exit While
                                End Try
                            End While
                            string_full = string_full & string_temp
                            TABLE_OF_STRINGS(string_i) = string_temp.Trim()
                            string_i = string_i + 1
                            If string_full.Length >= PDF_DATA.Tables(0).Rows(material_i).Item(column_i).ToString.Length Then
                                Exit While
                            Else
                                string_start = string_start + string_end - 1
                                string_end = 1
                                string_temp = ""
                            End If
                        End While
                    Else
                        TABLE_OF_STRINGS(string_i) = PDF_DATA.Tables(0).Rows(material_i).Item(column_i).ToString
                        string_i = string_i + 1
                    End If
                Next column_i

                If material_i > 0 Then
                    If PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString <> PDF_DATA.Tables(0).Rows(material_i - 1).Item(DATA.SET_SORT_1ST).ToString Then
                        DRAWER.SET_LOC_BIG_RECT_Y = DRAWER.SET_LOC_BIG_RECT_Y + XUnit.FromMillimeter(20).Point
                        DRAWER.SET_LOC_TEXT_Y = DRAWER.SET_LOC_TEXT_Y + XUnit.FromMillimeter(20).Point
                        DRAWER.SET_TEXT_MUG = True
                    Else
                        DRAWER.SET_TEXT_MUG = False
                    End If
                End If

                ' MHE1: PAGECHANGE IF NEEDED
                If XUnit.FromMillimeter(200).Point <= (DRAWER.SET_LOC_BIG_RECT_Y + DRAWER.SET_LOC_BIG_RECT_H + XUnit.FromMillimeter(1).Point + DRAWER.SET_FONT_BOLD_TEXT.Height + (DRAWER.SET_FONT_NORMAL_TEXT.Height * (string_i - 1))) Then
                    If DRAWER.SET_TEXT_MUG = True And PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString <> PDF_DATA.Tables(0).Rows(material_i - 1).Item(DATA.SET_SORT_1ST).ToString Then
                        If XUnit.FromPoint(PDF_DRAW.MeasureString(PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString, DRAWER.SET_FONT_SMALL_TEXT).Width).Millimeter > XUnit.FromMillimeter(100).Millimeter Then
                            Dim string_temp As String = ""
                            Dim string_full As String = ""
                            Dim string_start As Integer = 0
                            Dim string_end As Integer = 1
                            While string_temp = ""
                                While XUnit.FromPoint(PDF_DRAW.MeasureString(string_temp, DRAWER.SET_FONT_SMALL_TEXT).Width).Millimeter < XUnit.FromMillimeter(100).Millimeter
                                    Try
                                        string_temp = PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString.Substring(string_start, string_end)
                                        string_end = string_end + 1
                                    Catch ex As Exception
                                        Exit While
                                    End Try
                                End While
                                string_full = string_full & string_temp
                                If string_full.Length >= PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString.Length Then
                                    content = content & "?" & string_temp.Trim()
                                    Exit While
                                Else
                                    content = content & "?" & string_temp.Trim() & "&" & DRAWER.SET_TEXT_PAGE - 1
                                    string_start = string_start + string_end - 1
                                    string_end = 1
                                    string_temp = ""
                                End If
                            End While
                        Else
                            content = content & "?" & SPLIT_MEASURE_STRING(PDF_DRAW, PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString, 105, DRAWER.SET_FONT_SMALL_TEXT) & "&" & DRAWER.SET_TEXT_PAGE - 1
                        End If
                    End If
                    If pageside = False Then
                        pageside = True
                        PDF_DRAW = INSERT_MATERIAL_PAGE(PDF, DRAWER, pageside, PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString)
                        DRAWER.SET_TEXT_MUG = False
                    ElseIf pageside = True Then
                        pageside = False
                        PDF_DRAW = INSERT_MATERIAL_PAGE(PDF, DRAWER, pageside, PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString)
                        DRAWER.SET_TEXT_MUG = False
                    End If
                End If

                If DRAWER.SET_TEXT_MUG = True Then
                    If XUnit.FromPoint(PDF_DRAW.MeasureString(PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString, DRAWER.SET_FONT_SMALL_TEXT).Width).Millimeter > XUnit.FromMillimeter(100).Millimeter Then
                        Dim string_temp As String = ""
                        Dim string_full As String = ""
                        Dim string_start As Integer = 0
                        Dim string_end As Integer = 1
                        While string_temp = ""
                            While XUnit.FromPoint(PDF_DRAW.MeasureString(string_temp, DRAWER.SET_FONT_SMALL_TEXT).Width).Millimeter < XUnit.FromMillimeter(100).Millimeter
                                Try
                                    string_temp = PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString.Substring(string_start, string_end)
                                    string_end = string_end + 1
                                Catch ex As Exception
                                    Exit While
                                End Try
                            End While
                            string_full = string_full & string_temp
                            If string_full.Length >= PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString.Length Then
                                content = content & "?" & string_temp.Trim()
                                Exit While
                            Else
                                content = content & "?" & string_temp.Trim() & "&" & DRAWER.SET_TEXT_PAGE - 1
                                string_start = string_start + string_end - 1
                                string_end = 1
                                string_temp = ""
                            End If
                        End While
                    Else
                        content = content & "?" & SPLIT_MEASURE_STRING(PDF_DRAW, PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString, 105, DRAWER.SET_FONT_SMALL_TEXT) & "&" & DRAWER.SET_TEXT_PAGE - 1
                    End If
                Else
                End If



                For print_i As Integer = 0 To string_i - 2
                    Try
                        If print_i = 0 Then
                            If material_i > 0 Then
                                DRAWER.SET_LOC_BIG_RECT_Y = DRAWER.SET_LOC_BIG_RECT_Y + DRAWER.SET_LOC_BIG_RECT_H
                                DRAWER.SET_LOC_BIG_RECT_H = XUnit.FromMillimeter(1)
                                DRAWER.SET_LOC_TEXT_Y = DRAWER.SET_LOC_TEXT_Y + XUnit.FromMillimeter(1).Point
                            End If
                            PDF_DRAW.DrawString(TABLE_OF_STRINGS(print_i), DRAWER.SET_FONT_BOLD_TEXT, TEXT_BRUSH, New XPoint(DRAWER.SET_LOC_TEXT_X, DRAWER.SET_LOC_TEXT_Y))
                            DRAWER.SET_LOC_TEXT_Y = DRAWER.SET_LOC_TEXT_Y + DRAWER.SET_FONT_BOLD_TEXT.Height
                            DRAWER.SET_LOC_BIG_RECT_H = DRAWER.SET_LOC_BIG_RECT_H + DRAWER.SET_FONT_BOLD_TEXT.Height
                        ElseIf print_i = (string_i - 2) Then
                            If DRAWER.SET_TEXT_MUG = True Then
                                PDF_DRAW.DrawString(SPLIT_MEASURE_STRING(PDF_DRAW, PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString, 110, DRAWER.SET_FONT_HEAD_TEXT), DRAWER.SET_FONT_HEAD_TEXT, TEXT_BRUSH, New XPoint(DRAWER.SET_LOC_BIG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y - XUnit.FromMillimeter(5).Point))
                            End If
                            If DRAWER.SET_LOC_BIG_RECT_H > CType(XUnit.FromMillimeter(26), Double) Then
                                DRAWER.SET_LOC_PART_IMG_RECT_H = XUnit.FromMillimeter(26)
                            Else
                                DRAWER.SET_LOC_PART_IMG_RECT_H = DRAWER.SET_LOC_BIG_RECT_H
                            End If


                            ' PDF_DRAW.DrawImage(DATA.IMGDOWNLOAD(PDF_DATA.Tables(0).Rows(material_i).Item("PART IMAGE").ToString), New XRect(DRAWER.SET_LOC_PART_IMG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y, DRAWER.SET_LOC_PART_IMG_RECT_W, DRAWER.SET_LOC_PART_IMG_RECT_H))
                            PDF_DRAW.DrawImage(DATA.DBDOWNLOADIMAGE(PDF_DATA.Tables(0).Rows(material_i).Item("PART MASTER").ToString), New XRect(DRAWER.SET_LOC_PART_IMG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y, DRAWER.SET_LOC_PART_IMG_RECT_W, DRAWER.SET_LOC_PART_IMG_RECT_H))
                            PDF_DRAW.DrawRectangle(LINE_PEN, New XRect(DRAWER.SET_LOC_BIG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y, DRAWER.SET_LOC_BIG_RECT_W, DRAWER.SET_LOC_BIG_RECT_H))
                            PDF_DRAW.DrawRectangle(LINE_PEN, New XRect(DRAWER.SET_LOC_IMG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y, DRAWER.SET_LOC_IMG_RECT_W, DRAWER.SET_LOC_BIG_RECT_H))
                            Exit For
                        Else
                            PDF_DRAW.DrawString(TABLE_OF_STRINGS(print_i), DRAWER.SET_FONT_NORMAL_TEXT, TEXT_BRUSH, New XPoint(DRAWER.SET_LOC_TEXT_X, DRAWER.SET_LOC_TEXT_Y))
                            DRAWER.SET_LOC_TEXT_Y = DRAWER.SET_LOC_TEXT_Y + DRAWER.SET_FONT_NORMAL_TEXT.Height
                            DRAWER.SET_LOC_BIG_RECT_H = DRAWER.SET_LOC_BIG_RECT_H + DRAWER.SET_FONT_NORMAL_TEXT.Height
                        End If
                    Catch ex As Exception
                        If DRAWER.SET_TEXT_MUG = True Then
                            PDF_DRAW.DrawString(SPLIT_MEASURE_STRING(PDF_DRAW, PDF_DATA.Tables(0).Rows(material_i).Item(DATA.SET_SORT_1ST).ToString, 110, DRAWER.SET_FONT_HEAD_TEXT), DRAWER.SET_FONT_HEAD_TEXT, TEXT_BRUSH, New XPoint(DRAWER.SET_LOC_BIG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y - XUnit.FromMillimeter(5).Point))
                        End If
                        If DRAWER.SET_LOC_BIG_RECT_H > CType(XUnit.FromMillimeter(26), Double) Then
                            DRAWER.SET_LOC_PART_IMG_RECT_H = XUnit.FromMillimeter(26)
                        Else
                            DRAWER.SET_LOC_PART_IMG_RECT_H = DRAWER.SET_LOC_BIG_RECT_H
                        End If
                        'PDF_DRAW.DrawImage(DATA.IMGDOWNLOAD(PDF_DATA.Tables(0).Rows(material_i).Item("PART IMAGE").ToString), New XRect(DRAWER.SET_LOC_PART_IMG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y, DRAWER.SET_LOC_PART_IMG_RECT_W, DRAWER.SET_LOC_PART_IMG_RECT_H))
                        PDF_DRAW.DrawImage(DATA.DBDOWNLOADIMAGE(PDF_DATA.Tables(0).Rows(material_i).Item("PART MASTER").ToString), New XRect(DRAWER.SET_LOC_PART_IMG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y, DRAWER.SET_LOC_PART_IMG_RECT_W, DRAWER.SET_LOC_PART_IMG_RECT_H))
                        PDF_DRAW.DrawRectangle(LINE_PEN, New XRect(DRAWER.SET_LOC_BIG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y, DRAWER.SET_LOC_BIG_RECT_W, DRAWER.SET_LOC_BIG_RECT_H))
                        PDF_DRAW.DrawRectangle(LINE_PEN, New XRect(DRAWER.SET_LOC_IMG_RECT_X, DRAWER.SET_LOC_BIG_RECT_Y, DRAWER.SET_LOC_IMG_RECT_W, DRAWER.SET_LOC_BIG_RECT_H))
                        Exit For
                    End Try
                Next print_i

            Next material_i
            'MHE1: ??
            'aa.EndImpersonation()

            ' MHE1: Print content pages
            Dim TABLE_OF_CONTENTS = content.Split("?")
            If contentpageside = True Then
                pageside = False
                PDF_DRAW = INSERT_CONTENT_PAGE(PDF, DRAWER, contentpageside, DATA.SET_SORT_1ST)
            ElseIf pageside = False Then
                contentpageside = True
                PDF_DRAW = INSERT_CONTENT_PAGE(PDF, DRAWER, contentpageside, DATA.SET_SORT_1ST)
            End If
            For content_i As Integer = 0 To TABLE_OF_CONTENTS.Length - 1
                ' MHE1: PAGECHANGE IF NEEDED
                If XUnit.FromMillimeter(195).Point <= (DRAWER.SET_LOC_TEXT_Y + DRAWER.SET_FONT_BOLD_TEXT.Height + XUnit.FromMillimeter(1).Point) Then
                    If contentpageside = False Then
                        contentpageside = True
                        PDF_DRAW = INSERT_CONTENT_PAGE(PDF, DRAWER, contentpageside, DATA.SET_SORT_1ST)
                    ElseIf contentpageside = True Then
                        contentpageside = False
                        PDF_DRAW = INSERT_CONTENT_PAGE(PDF, DRAWER, contentpageside, DATA.SET_SORT_1ST)
                    End If
                End If
                Try
                    If contentpageside = True Then
                        PDF_DRAW.DrawString(TABLE_OF_CONTENTS(content_i).Split("&")(0), DRAWER.SET_FONT_SMALL_TEXT, TEXT_BRUSH, New XPoint(DRAWER.SET_LOC_TEXT_X, DRAWER.SET_LOC_TEXT_Y))
                        Try
                            PDF_DRAW.DrawString(TABLE_OF_CONTENTS(content_i).Split("&")(1), DRAWER.SET_FONT_SMALL_TEXT, TEXT_BRUSH, New XPoint(XUnit.FromMillimeter(DRAWER.SET_LOC_PAGE_W - (20 + XUnit.FromPoint(PDF_DRAW.MeasureString(TABLE_OF_CONTENTS(content_i).Split("&")(1), DRAWER.SET_FONT_SMALL_TEXT).Width).Millimeter)), DRAWER.SET_LOC_TEXT_Y))
                        Catch ex As Exception
                        End Try
                    ElseIf contentpageside = False Then
                        PDF_DRAW.DrawString(TABLE_OF_CONTENTS(content_i).Split("&")(0), DRAWER.SET_FONT_SMALL_TEXT, TEXT_BRUSH, New XPoint(DRAWER.SET_LOC_TEXT_X, DRAWER.SET_LOC_TEXT_Y))
                        Try
                            PDF_DRAW.DrawString(TABLE_OF_CONTENTS(content_i).Split("&")(1), DRAWER.SET_FONT_SMALL_TEXT, TEXT_BRUSH, New XPoint(XUnit.FromMillimeter(DRAWER.SET_LOC_PAGE_W - (10 + XUnit.FromPoint(PDF_DRAW.MeasureString(TABLE_OF_CONTENTS(content_i).Split("&")(1), DRAWER.SET_FONT_SMALL_TEXT).Width).Millimeter)), DRAWER.SET_LOC_TEXT_Y))
                        Catch ex As Exception
                        End Try
                    End If
                    DRAWER.SET_LOC_TEXT_Y = DRAWER.SET_LOC_TEXT_Y + DRAWER.SET_FONT_BOLD_TEXT.Height
                Catch ex As Exception

                End Try
            Next content_i

            If 0 <> DRAWER.SET_COUNT_CONTENT_PAGE Mod 2 Then
                If contentpageside = False Then
                    contentpageside = True
                    INSERT_CONTENT_PAGE(PDF, DRAWER, contentpageside, DATA.SET_SORT_1ST, True)
                ElseIf contentpageside = True Then
                    contentpageside = False
                    INSERT_CONTENT_PAGE(PDF, DRAWER, contentpageside, DATA.SET_SORT_1ST, True)
                End If
            End If

            ' MHE1: Ensure that page amount will be dividable by 4
            Dim divided As Double
            divided = (PDF.PageCount + 1) Mod 4
            While divided <> 0
                If pageside = False Then
                    pageside = True
                    INSERT_EMPTY_PAGE(PDF, DRAWER, pageside)
                ElseIf pageside = True Then
                    pageside = False
                    INSERT_EMPTY_PAGE(PDF, DRAWER, pageside)
                End If
                divided = (PDF.PageCount + 1) Mod 4
            End While

            ' MHE1: Draw back cover
            INSERT_BACKCOVER(PDF, DRAWER)
            ' MHE1: Save pdf
            Dim PDFNAME As String = DRAWER.SET_TEXT_TITLE & "_" & DateTime.Now.ToString("yyyy-MM-dd-HH-mm")

            PDFNAME = PDFNAME.Replace(":", "")
            PDFNAME = PDFNAME.Replace(" ", "_")
            PDFNAME = PDFNAME.Replace("|", "_")
            PDFNAME = PDFNAME.Replace("&", "_")
            ' TEETÄMÄ
            'PDFPATH = "<a href='" & pyoCatalogueUrlPath & "/" & PDFNAME & ".pdf' target='_blank' style='display: inline-block;line-height: 30px;margin: 0;padding: 0;padding-left: 11px;padding-right: 11px;height: 30px;min-width: 57px;text-align: center;vertical-align: center;font-family: arial, sans-serif;font-size: 12px;font-weight: bold;border-color: #E6E6E6;border-width: 1px;border-style: solid;background-image: -ms-linear-gradient(rgb(245, 245, 245), rgb(241, 241, 241));background-color: rgb(245, 245, 245);color: #444;text-decoration: none;'>Download</a>&nbsp;&nbsp;&nbsp;<a href='' onclick='ShowNavigationPYO(); return false;' style='display: inline-block;line-height: 30px;margin: 0;padding: 0;padding-left: 11px;padding-right: 11px;height: 30px;min-width: 57px;text-align: center;vertical-align: center;font-family: arial, sans-serif;font-size: 12px;font-weight: bold;border-color: #E6E6E6;border-width: 1px;border-style: solid;background-image: -ms-linear-gradient(rgb(245, 245, 245), rgb(241, 241, 241));background-color: rgb(245, 245, 245);color: #444;text-decoration: none;'>Back to print your own</a>"

            PDFPATH = pyoCatalogueUrlPath & "/" & PDFNAME & ".pdf"
            ' Console.WriteLine(PDFNAME)

            'aa = New AliasAccount(imageFolderUser, imageLocationPassword, "KONENET")
            'aa.BeginImpersonation()
            'PDF.Save("\\eudvmnt022\DAR\" & PDFNAME & ".pdf")
            PDF.Save(pyoCatalogueSavePath & "\" & PDFNAME & ".pdf")
            'aa.EndImpersonation()
        Else
            'PDFPATH = "No matches found, <a href='' onclick='ShowNavigationPYO(); return false;' style='display: inline-block;line-height: 30px;margin: 0;padding: 0;padding-left: 11px;padding-right: 11px;height: 30px;min-width: 57px;text-align: center;vertical-align: center;font-family: arial, sans-serif;font-size: 12px;font-weight: bold;border-color: #E6E6E6;border-width: 1px;border-style: solid;background-image: -ms-linear-gradient(rgb(245, 245, 245), rgb(241, 241, 241));background-color: rgb(245, 245, 245);color: #444;text-decoration: none;'>Back to print your own</a>"
            PDFPATH = "No matches found"
        End If


    End Sub


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 22, 2015 10:27 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
Hi!
sudhakarrajuk wrote:
for ex..take a sentance.. "PDF Sharp is used to create pdfdocument"...here in this sentance pdfdocument is displaying in 2 lines..intead i want total 'pdfdocument' word to display in next line.
AFAIK you have to use the XTextFormatter class to get word wrapping.
See also:
http://pdfsharp.net/wiki/TextLayout-sample.ashx

Or use MigraDoc to get word wrapping and automatic page breaks.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 53 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group