Sign In  Sign Up Live-Chat

Header Shifts (footer too)

Last post 09-20-2007, 9:27 AM by rraiford. 8 replies.
Sort Posts: Previous Next
  •  08-09-2007, 3:50 PM 90135

    Header Shifts (footer too)

    I have a muliple page report and the header moves from the first page to the second page, they are different sections.  The header starts off in the correct location but in each of the pages following the first page the header information is moved down about a half inch.  I use the same code to set the section information as well as build the header.

    The section code is below

    'format the sections

    For Each sec As Section In pdf.Sections

    sec.IsLandscape = True

    sec.BackgroundImageFile = backGroundLocation

    sec.BackgroundImageType = ImageFileType.Gif

    sec.PageInfo.Margin.Top = 80

    sec.PageInfo.Margin.Left = 112

    sec.PageInfo.Margin.Bottom = 40

    Next

    And here is the section that builds the header

    Private Sub BuildHeader(ByRef header As HeaderFooter)

    Dim headerTable As Table

    Dim titleInfo As TextInfo

    titleInfo = New TextInfo

    titleInfo.Alignment = AlignmentType.Left

    titleInfo.FontSize = 18

    titleInfo.FontName = "Arial"

    titleInfo.Color = lightBlue

    titleInfo.IsTrueTypeFontBold = True

    'build the main table

    headerTable = New Table

    headerTable.Alignment = AlignmentType.Left

    headerTable.DefaultCellPadding.Top = 30

    headerTable.ColumnWidths = "725"

    headerTable.Rows.Add().Cells.Add().Paragraphs.Add(New Text("REPORT" & Environment.NewLine, titleInfo))

    'add main table to the header

    header.Paragraphs.Add(headerTable)

    End Sub

    This is also happening with the footer, but the only idfference is instead of the information moving down, it moves to the right.

    Any ideas?

     
  •  08-09-2007, 10:05 PM 90155 in reply to 90135

    Re: Header Shifts (footer too)

    Hi,

    Thank you for considering Aspose.

    I am not been able to reproduce this problem with latest version of Aspose.Pdf. Could you please share your complete code or send it to adeel.ahmad@aspose.com and let us investigate this problem. Please also tell us that are you using the latest version of Aspose.Pdf?

    Thanks.
     
  •  08-14-2007, 3:42 PM 90736 in reply to 90155

    Re: Header Shifts (footer too)

    Dear Robert,

    We have checked your source code, but as it is complex and contains SQL , which might prevent us from getting the main problem. Could you please provide with some sample source in runnable format. Then we can investigate the problem.

    Thanks.

     
  •  09-06-2007, 9:09 AM 93778 in reply to 90736

    Re: Header Shifts (footer too)

    Attachment: Present (inaccessible)

    I have created a runnable version of the header shifting problem.   I was also able to determine that the problem has to do with adding a background image.  Attached is the module to create the pdf, a background image, and two sample outputs, one with a background and one without.  As you can see the one without the background works fine, when the background image is added however the shifting occurrs.

    Note: the background image will need to be placed in C:\Temp\LandscapeBackground.gif and a license file will need to be in the bin directory for this sample to run.

     
  •  09-06-2007, 8:57 PM 93872 in reply to 93778

    Re: Header Shifts (footer too)

    Hi,

    Thanks for sharing the code, it looks that problem arises when we set the background image. I am able to reproduce this error and logged as PDFNET-3699. I will discuss this issue with the developers and we will let you know as soon as solution is found.

    Thanks.

     
  •  09-14-2007, 5:38 PM 95020 in reply to 90135

    Re: Header Shifts (footer too)

    Attachment: Present (inaccessible)
    Hi,

    The bug has been fixed. Please try the attachment before we publish new hotfix.

    Best regards.
    Hans Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-17-2007, 12:11 PM 95177 in reply to 95020

    Re: Header Shifts (footer too)

    I have not been able to try the fix yet, my license expired last week so I can't run the new fix.  I will try it when purchasing gets me a new license within the next week.

    Thanks,

    B.J.

     
  •  09-17-2007, 7:46 PM 95209 in reply to 95177

    Re: Header Shifts (footer too)

    You can try it first without license. Just comment the license code.

    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-20-2007, 9:27 AM 95598 in reply to 95209

    Re: Header Shifts (footer too)

    Looks good to me, the header is in the same place on each page now.
     
View as RSS news feed in XML