Not a good start!

I have used Cells.Net and Words.Net for many years, but PDF.Net is giving me a hard time. Firstly there is confusion about using “Generator” DOM or just the main DOM. Examples exist using both which are incompatible with each other and some examples only exist in one or the other!

I’ve realised that there really is no such things as headers and footers. Sections seems to exist in generator but not the core DOM. Here is a simple VB.Net example which first creates a table and fills with lots of rows which make the table wrap onto more than one page. Next I create a top left header, top right header and bottom left footer and bottom right page number footer. As soon as I try to wrap the text in the top left header, it simply moves down the page for no reason! Then I try to add the stamps to each page in the document and find that only two pages exist despite the fact that the table has created extra pages! Right now can’t seem to loop through all pages and add headers/footers. This is driving me crazy! Any help most appreciated.

Dim doc As New Aspose.Pdf.Document()
Dim PageInfo As Aspose.Pdf.PageInfo = doc.PageInfo
Dim marginInfo As Aspose.Pdf.MarginInfo = PageInfo.Margin

marginInfo.Left = 36
marginInfo.Right = 36
marginInfo.Top = 48
marginInfo.Bottom = 48

'PageInfo.IsLandscape = True

Dim curPage As Aspose.Pdf.Page = doc.Pages.Add()
Dim paragraphs As Aspose.Pdf.Paragraphs = curPage.Paragraphs
Dim dt As DataTable = New DataTable(“Employee”)
dt.Columns.Add(“Employee_ID”, GetType(Int32))
dt.Columns.Add(“Employee_Name”, GetType(String))
dt.Columns.Add(“Gender”, GetType(String))
For i As Integer = 1 To 150
dt.Rows.Add(i, “John Smith”, “Male”)
Next
Dim table1 As Aspose.Pdf.Table = New Aspose.Pdf.Table()
table1.ColumnWidths = “100 100 100”
table1.ImportDataTable(dt, True, 0, 0)
'table1.IsInNewPage = True
paragraphs.Add(table1)

'now try to add a header (known as a stamp)
Dim TLHeaderStamp As New Aspose.Pdf.TextStamp(“Expenses for Brown C (341) that were processed by Atkinson C (18) - 2017-02-21 11:32”)
TLHeaderStamp.VerticalAlignment = VerticalAlignment.Top
TLHeaderStamp.HorizontalAlignment = HorizontalAlignment.Left
TLHeaderStamp.TextState.FontSize = 12
TLHeaderStamp.LeftMargin = 36
TLHeaderStamp.Width = 288
TLHeaderStamp.WordWrap = True
TLHeaderStamp.TopMargin = 24

Dim TRHeaderStamp As New Aspose.Pdf.TextStamp(Now.Date.ToString(“dd-MMM-yy”))
TRHeaderStamp.VerticalAlignment = VerticalAlignment.Top
TRHeaderStamp.HorizontalAlignment = HorizontalAlignment.Right
TRHeaderStamp.TextState.FontSize = 12
TRHeaderStamp.TopMargin = 24
TRHeaderStamp.RightMargin = 36

Dim BLFooterStamp As New Aspose.Pdf.TextStamp(“Manager”)
BLFooterStamp.VerticalAlignment = VerticalAlignment.Bottom
BLFooterStamp.HorizontalAlignment = HorizontalAlignment.Left
BLFooterStamp.TextState.FontSize = 10
BLFooterStamp.BottomMargin = 24
BLFooterStamp.LeftMargin = 36

Dim BRFooterStamp As New Aspose.Pdf.PageNumberStamp()
BRFooterStamp.VerticalAlignment = VerticalAlignment.Bottom
BRFooterStamp.HorizontalAlignment = HorizontalAlignment.Right
BRFooterStamp.TextState.FontSize = 10
BRFooterStamp.BottomMargin = 24
BRFooterStamp.RightMargin = 36

'Now add another page and see what happens to stamps
curPage = doc.Pages.Add()

For Each currPage As Aspose.Pdf.Page In doc.Pages
currPage.AddStamp(TLHeaderStamp)
currPage.AddStamp(TRHeaderStamp)
currPage.AddStamp(BLFooterStamp)
currPage.AddStamp(BRFooterStamp)
Next

doc.Save(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "" & “programaticallyproducedpdf.pdf”)
System.Diagnostics.Process.Start(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "" & “programaticallyproducedpdf.pdf”)

Hi Martin,


Thanks for using our API’s.

First of all please accept our humble apologies for the confusion and inconvenience caused. Please note that the DOM under Aspose.Pdf namespace is new and recommended approach. Furthermore, I have tested above stated scenario and have managed to reproduce same problems. For the sake of correction, I have logged it as PDFNET-42360 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

I bought this component so that I could quickly produce PDF files within a few weeks. Can you give me some clue as to how long these fixes will take please so that I can continue my work or seek another component elsewhere. Thanks

Hi Martin,


Thanks for contacting support.

Please note that we recently have been notified about the logged issue so it is still pending for review. A fix to this issue will definitely be planned once other issues in the queue are get resolved which were definitely logged before this. Your patience will be really appreciated in this matter. We will keep you informed about the resolution status. Please give us a little time.

We are sorry for the inconvenience.


Best Regards,

“Still pending for review” is not very encouraging! I can’t wait 6 weeks for a resolution to this - I must produce my software within two weeks. Being able to do a multi-page table and then add headers/footers is such a basic requirement that I would have to describe your PDF dot net component as seriously flawed. Will you allow a refund for the license in this case please?

Hi Martin,


Please accept my humble apologies for delay in the resolution process. However I would like to share that we do realize the severity level of the issue. I have recorded your concerns and raised the issue to the next level. We will definitely update you soon. Please be patient and spare us a little time.

We are sorry for this delay and inconvenience.


Best Regards,

It is now nearly a month since you added this bug. When will a new version be released please?

Hi Martin,


Thanks for your inquiry.

I am afraid that we cannot provide any time frame or ETA for now. Please note that not all reported issues have been resolved in upcoming releases as development team has their own schedule to resolve the issues. I am sure that they will soon provide a fix against your issue as per their development schedule as we already have intimated them about your concerns. Please be patient and cooperate with us in this process. We will let you know once we have some definite updates regarding this. Please give us a little time.

We are sorry for the inconvenience.


Best Regards,

Another week goes by…component must be more broken that I imagined. Still can’t believe that I’m the first to create a PDF from scratch, then add a multi-page table and then add headers and footers to each page. My customer is getting fed up to be honest and wishes that I had tested your component before purchase. Seriously though, how could I imagine that something so basic wouldn’t actually work?

Hi Martin,


Thanks for your patience.

As shared earlier, the issue is still pending for review as we recently have noticed this problem. Please note that each issue is equal important and we try our best to resolve issues as quickly as possible. But, in order to accommodate all issues, we have to follow some mechanism so that all issues are given due importance and therefore we follow the First come First serve approach. Please note that there are many customers who are successfully using our API while creating and manipulating PDF files but I am afraid its causing issue in your specific scenario. Even though the problem in this thread is recently noticed, however considering the fact of inconvenience which you have been facing, I have shared your concerns with product team and have requested them to try accommodating the investigation in their development schedule.

I am not entirely certain about the priority that will be given to this issue but as soon as we have some definite updates, we will let you know. We are sorry for this delay and inconvenience.

Two months now since I purchased this component for £1,585.00 and still can’t generate a multi-page PDF from scratch with a multi-page table and headers/footers in the correct position. I don’t doubt that lots of other users are using it quite successfully in other ways, but surely being able to create a basic PDF with a multi-page table and headers that stay at the correct position is not asking too much?

I’ve already lost 2 months of updates of this component and my customer is totally un-impressed that I can’t yet provide what they need. This reflects badly on me. I have always been impressed with Words/Cells, so this is why I went with your PDF component. Come on Aspose!

Hello Martin,


Thanks for your patience. I am afraid that earlier logged issue is not resolved yet because development team has been busy in resolving other issues. As shared above that every issue has been given equal importance to resolve and they have been resolved on first come first serve basis, which we believe, is the fairest policy to everyone. Though I have intimated the relevant team about your concerns and requested them if they can share an ETA regarding resolution of the issue.

We really appreciate your patience and comprehension in this matter. We will certainly let you know about the updates as soon as we have some regarding resolution process. Please be patient and spare us a little time.

We are sorry for the delay and inconvenience faced.


Best Regards,

Hi Martin,

Thanks for your patience.

We have further investigated earlier reported issues and as per our observations, the generation of the table is executed when document is saved. That is why stamps are added only on 1st and 4th page (2nd and 3rd are added during generator processing)

Therefore it is enough to save document into stream and reload back and add stamps after this.
Please take a look over following code snippet.

Dim doc As Aspose.Pdf.Document = New Document()
Dim curPage As Aspose.Pdf.Page = doc.Pages.Add()
Dim paragraphs As Aspose.Pdf.Paragraphs = curPage.Paragraphs

Dim dt As DataTable = New DataTable("Employee")
dt.Columns.Add("Employee_ID", GetType(Int32))
dt.Columns.Add("Employee_Name", GetType(String))
dt.Columns.Add("Gender", GetType(String))

For i As Integer = 1 To 150
    dt.Rows.Add(i, "John Smith", "Male")
Next

Dim table1 As Aspose.Pdf.Table = New Aspose.Pdf.Table()
table1.ColumnWidths = "100 100 100"
table1.ImportDataTable(dt, True, 0, 0)

paragraphs.Add(table1)

' Now try to add a header (known as a stamp)
Dim TLHeaderStamp As New Aspose.Pdf.TextStamp("Expenses for Brown C (341) that were processed by Atkinson C (18) - 2017-02-21 11:32")
TLHeaderStamp.VerticalAlignment = VerticalAlignment.Top
TLHeaderStamp.HorizontalAlignment = HorizontalAlignment.Left
TLHeaderStamp.TextState.FontSize = 12
TLHeaderStamp.LeftMargin = 36
TLHeaderStamp.Width = 288
TLHeaderStamp.WordWrap = True
TLHeaderStamp.TopMargin = 24

Dim TRHeaderStamp As New Aspose.Pdf.TextStamp(Now.Date.ToString("dd-MMM-yy"))
TRHeaderStamp.VerticalAlignment = VerticalAlignment.Top
TRHeaderStamp.HorizontalAlignment = HorizontalAlignment.Right
TRHeaderStamp.TextState.FontSize = 12
TRHeaderStamp.TopMargin = 24
TRHeaderStamp.RightMargin = 36

Dim BLFooterStamp As New Aspose.Pdf.TextStamp("Manager")
BLFooterStamp.VerticalAlignment = VerticalAlignment.Bottom
BLFooterStamp.HorizontalAlignment = HorizontalAlignment.Left
BLFooterStamp.TextState.FontSize = 10
BLFooterStamp.BottomMargin = 24
BLFooterStamp.LeftMargin = 36

Dim BRFooterStamp As New Aspose.Pdf.PageNumberStamp()
BRFooterStamp.VerticalAlignment = VerticalAlignment.Bottom
BRFooterStamp.HorizontalAlignment = HorizontalAlignment.Right
BRFooterStamp.TextState.FontSize = 10
BRFooterStamp.BottomMargin = 24
BRFooterStamp.RightMargin = 36

' Now add another page and see what happens to stamps
curPage = doc.Pages.Add()

' Save and load the document
Dim ms As New MemoryStream()
doc.Save(ms)
ms.Seek(0, SeekOrigin.Begin)
doc = New Document(ms)

For Each currPage As Aspose.Pdf.Page In doc.Pages
    currPage.AddStamp(TLHeaderStamp)
    currPage.AddStamp(TRHeaderStamp)
    currPage.AddStamp(BLFooterStamp)
    currPage.AddStamp(BRFooterStamp)
Next

doc.Save("c:/pdftest/programaticallyproducedpdf.pdf")

Thank you. Using doc.ProcessParagraphs() has successfully forced all pages to be generated prior to document save. This leaves the issue with the top left stamp which does not appear in the correct position when aligned top and left. This is still a major problem for my customer

msutherland25:
Thank you. Using doc.ProcessParagraphs() has successfully forced all pages to be generated prior to document save. This leaves the issue with the top left stamp which does not appear in the correct position when aligned top and left. This is still a major problem for my customer
Hi Martin,

Thanks for sharing the updates.

From above mentioned description, do you mean the rendering of “Expenses for Brown C (341) that were processed by Atkinson C (18) - 2017-02-21 11:32” ?

Please share some further details, so we may reply accordingly.

Yes, the stamp appears much further down the page when rendered and thus overwrites important information underneath. This only happens to the top left stamp - all others appear correctly…

Hi Martin,

Thanks for using our API’s.

I have logged above stated issue (incorrect rendering of TextStamp) as PDFNET-42702 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.