itext7 table SetFixedPosition on Page 1 fails












0















I can´t believe, what I see....
I try to print a table with itext7 into a PDF on a defined page. The table-creation is made as last statement before finishing the PDF.



The PDF has (after finishing) 5 pages. I can print the table to every page except the first page.



This is my code:



    If placeOnPage = 0 Then
table.SetFixedPosition(200, 250, 100)
Else
table.SetFixedPosition(placeOnPage, 200, 250, 100)
End If


If placeOnPage = 0, then the table is printed correctly on the last page. If I set placeOnPage to values between 2 and 5, the table is correctly placed on page 2, 3, 4 or 5. But if I set placeOnPage to 1, I get an error at the line



doc.add(table)


The error says:



System.NullReferenceException: "object reference not set to an instance of an object"


I don´t know which object is NULL. Everythin else is exactly the same in all my tries....



Can anybody give me a hint?



Regards,



Benni



StackTrace:



   bei KernelExtensions.Get[TKey,TValue](IDictionary´2 col, TKey key)
bei iText.Kernel.Pdf.PdfDictionary.Get(PdfName key, Boolean asDirect)
bei iText.Kernel.Pdf.PdfDictionary.Get(PdfName key)
bei iText.Kernel.Pdf.PdfPage.GetContentStreamCount()
bei iText.Kernel.Pdf.PdfPage.GetLastContentStream()
bei iText.Kernel.Pdf.Canvas.PdfCanvas.GetPageStream(PdfPage page)
bei iText.Kernel.Pdf.Canvas.PdfCanvas..ctor(PdfPage page, Boolean wrapOldContent)
bei iText.Layout.Renderer.DocumentRenderer.FlushSingleRenderer(IRenderer resultRenderer)
bei iText.Layout.Renderer.RootRenderer.AddChild(IRenderer renderer)
bei iText.Layout.RootElement´1.CreateAndAddRendererSubTree(IElement element)
bei iText.Layout.RootElement´1.Add(IBlockElement element)
bei iText.Layout.Document.Add(IBlockElement element)
bei iTextPDF.class_iTextPDF.TableEnd() in D:Documents15 - Visual Studio ProjectsiTextPDFiTextPDFiTextPDF.vb:Zeile 1668.
bei iTextPDF.class_iTextPDF.addTextFrame(String text, String posLowerLeftPointFromLeft, String posLowerLeftPointFromBottom, String width, String height, PdfFont font, Single fontSize, Color fontColor, Single strokeWidth, Color strokeColor, Color fillColor, TextAlignment alignment, String innerSpacing, Int32 placeOnPage) in D:Documents15 - Visual Studio ProjectsiTextPDFiTextPDFiTextPDF.vb:Zeile 1360.
bei iTextPDFTest.Form1.Button1_Click(Object sender, EventArgs e) in D:Documents15 - Visual Studio ProjectsiTextPDFTestiTextPDFTestForm1.vb:Zeile 225.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.PerformClick()
bei iTextPDFTest.Form1.Form1_Load(Object sender, EventArgs e) in D:Documents15 - Visual Studio ProjectsiTextPDFTestiTextPDFTestForm1.vb:Zeile 9.
bei System.EventHandler.Invoke(Object sender, EventArgs e)
bei System.Windows.Forms.Form.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)









share|improve this question

























  • "I don´t know which object is NULL" please show the stack trace of the error. Chances are, though, that the pdf in question and enough code to reproduce the error with it also are required to analyze the issue.

    – mkl
    Nov 21 '18 at 18:50











  • I added StackTrace to the question... (too lonr for comment)

    – BeSt
    Nov 22 '18 at 9:02











  • A NullReferenceException there sounds like the page dictionary object has already been released at the time this happens. iText usually attempts to flush generated pages to output as early as possible and then releases their data. Probably your code triggers that flushing before adding that table to page 1? To analyze this better more code is necessary.

    – mkl
    Nov 22 '18 at 10:47













  • Yes, this is shurely the reason. What I try is to add the table to the first page at the very end of the generation of the PDF document. The document finally has 5 pages, and just before doc.close I want to add the table to page 1. So this is not possible? And what about opening an existing document and adding a table to the first page?

    – BeSt
    Nov 22 '18 at 10:56


















0















I can´t believe, what I see....
I try to print a table with itext7 into a PDF on a defined page. The table-creation is made as last statement before finishing the PDF.



The PDF has (after finishing) 5 pages. I can print the table to every page except the first page.



This is my code:



    If placeOnPage = 0 Then
table.SetFixedPosition(200, 250, 100)
Else
table.SetFixedPosition(placeOnPage, 200, 250, 100)
End If


If placeOnPage = 0, then the table is printed correctly on the last page. If I set placeOnPage to values between 2 and 5, the table is correctly placed on page 2, 3, 4 or 5. But if I set placeOnPage to 1, I get an error at the line



doc.add(table)


The error says:



System.NullReferenceException: "object reference not set to an instance of an object"


I don´t know which object is NULL. Everythin else is exactly the same in all my tries....



Can anybody give me a hint?



Regards,



Benni



StackTrace:



   bei KernelExtensions.Get[TKey,TValue](IDictionary´2 col, TKey key)
bei iText.Kernel.Pdf.PdfDictionary.Get(PdfName key, Boolean asDirect)
bei iText.Kernel.Pdf.PdfDictionary.Get(PdfName key)
bei iText.Kernel.Pdf.PdfPage.GetContentStreamCount()
bei iText.Kernel.Pdf.PdfPage.GetLastContentStream()
bei iText.Kernel.Pdf.Canvas.PdfCanvas.GetPageStream(PdfPage page)
bei iText.Kernel.Pdf.Canvas.PdfCanvas..ctor(PdfPage page, Boolean wrapOldContent)
bei iText.Layout.Renderer.DocumentRenderer.FlushSingleRenderer(IRenderer resultRenderer)
bei iText.Layout.Renderer.RootRenderer.AddChild(IRenderer renderer)
bei iText.Layout.RootElement´1.CreateAndAddRendererSubTree(IElement element)
bei iText.Layout.RootElement´1.Add(IBlockElement element)
bei iText.Layout.Document.Add(IBlockElement element)
bei iTextPDF.class_iTextPDF.TableEnd() in D:Documents15 - Visual Studio ProjectsiTextPDFiTextPDFiTextPDF.vb:Zeile 1668.
bei iTextPDF.class_iTextPDF.addTextFrame(String text, String posLowerLeftPointFromLeft, String posLowerLeftPointFromBottom, String width, String height, PdfFont font, Single fontSize, Color fontColor, Single strokeWidth, Color strokeColor, Color fillColor, TextAlignment alignment, String innerSpacing, Int32 placeOnPage) in D:Documents15 - Visual Studio ProjectsiTextPDFiTextPDFiTextPDF.vb:Zeile 1360.
bei iTextPDFTest.Form1.Button1_Click(Object sender, EventArgs e) in D:Documents15 - Visual Studio ProjectsiTextPDFTestiTextPDFTestForm1.vb:Zeile 225.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.PerformClick()
bei iTextPDFTest.Form1.Form1_Load(Object sender, EventArgs e) in D:Documents15 - Visual Studio ProjectsiTextPDFTestiTextPDFTestForm1.vb:Zeile 9.
bei System.EventHandler.Invoke(Object sender, EventArgs e)
bei System.Windows.Forms.Form.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)









share|improve this question

























  • "I don´t know which object is NULL" please show the stack trace of the error. Chances are, though, that the pdf in question and enough code to reproduce the error with it also are required to analyze the issue.

    – mkl
    Nov 21 '18 at 18:50











  • I added StackTrace to the question... (too lonr for comment)

    – BeSt
    Nov 22 '18 at 9:02











  • A NullReferenceException there sounds like the page dictionary object has already been released at the time this happens. iText usually attempts to flush generated pages to output as early as possible and then releases their data. Probably your code triggers that flushing before adding that table to page 1? To analyze this better more code is necessary.

    – mkl
    Nov 22 '18 at 10:47













  • Yes, this is shurely the reason. What I try is to add the table to the first page at the very end of the generation of the PDF document. The document finally has 5 pages, and just before doc.close I want to add the table to page 1. So this is not possible? And what about opening an existing document and adding a table to the first page?

    – BeSt
    Nov 22 '18 at 10:56
















0












0








0


0






I can´t believe, what I see....
I try to print a table with itext7 into a PDF on a defined page. The table-creation is made as last statement before finishing the PDF.



The PDF has (after finishing) 5 pages. I can print the table to every page except the first page.



This is my code:



    If placeOnPage = 0 Then
table.SetFixedPosition(200, 250, 100)
Else
table.SetFixedPosition(placeOnPage, 200, 250, 100)
End If


If placeOnPage = 0, then the table is printed correctly on the last page. If I set placeOnPage to values between 2 and 5, the table is correctly placed on page 2, 3, 4 or 5. But if I set placeOnPage to 1, I get an error at the line



doc.add(table)


The error says:



System.NullReferenceException: "object reference not set to an instance of an object"


I don´t know which object is NULL. Everythin else is exactly the same in all my tries....



Can anybody give me a hint?



Regards,



Benni



StackTrace:



   bei KernelExtensions.Get[TKey,TValue](IDictionary´2 col, TKey key)
bei iText.Kernel.Pdf.PdfDictionary.Get(PdfName key, Boolean asDirect)
bei iText.Kernel.Pdf.PdfDictionary.Get(PdfName key)
bei iText.Kernel.Pdf.PdfPage.GetContentStreamCount()
bei iText.Kernel.Pdf.PdfPage.GetLastContentStream()
bei iText.Kernel.Pdf.Canvas.PdfCanvas.GetPageStream(PdfPage page)
bei iText.Kernel.Pdf.Canvas.PdfCanvas..ctor(PdfPage page, Boolean wrapOldContent)
bei iText.Layout.Renderer.DocumentRenderer.FlushSingleRenderer(IRenderer resultRenderer)
bei iText.Layout.Renderer.RootRenderer.AddChild(IRenderer renderer)
bei iText.Layout.RootElement´1.CreateAndAddRendererSubTree(IElement element)
bei iText.Layout.RootElement´1.Add(IBlockElement element)
bei iText.Layout.Document.Add(IBlockElement element)
bei iTextPDF.class_iTextPDF.TableEnd() in D:Documents15 - Visual Studio ProjectsiTextPDFiTextPDFiTextPDF.vb:Zeile 1668.
bei iTextPDF.class_iTextPDF.addTextFrame(String text, String posLowerLeftPointFromLeft, String posLowerLeftPointFromBottom, String width, String height, PdfFont font, Single fontSize, Color fontColor, Single strokeWidth, Color strokeColor, Color fillColor, TextAlignment alignment, String innerSpacing, Int32 placeOnPage) in D:Documents15 - Visual Studio ProjectsiTextPDFiTextPDFiTextPDF.vb:Zeile 1360.
bei iTextPDFTest.Form1.Button1_Click(Object sender, EventArgs e) in D:Documents15 - Visual Studio ProjectsiTextPDFTestiTextPDFTestForm1.vb:Zeile 225.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.PerformClick()
bei iTextPDFTest.Form1.Form1_Load(Object sender, EventArgs e) in D:Documents15 - Visual Studio ProjectsiTextPDFTestiTextPDFTestForm1.vb:Zeile 9.
bei System.EventHandler.Invoke(Object sender, EventArgs e)
bei System.Windows.Forms.Form.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)









share|improve this question
















I can´t believe, what I see....
I try to print a table with itext7 into a PDF on a defined page. The table-creation is made as last statement before finishing the PDF.



The PDF has (after finishing) 5 pages. I can print the table to every page except the first page.



This is my code:



    If placeOnPage = 0 Then
table.SetFixedPosition(200, 250, 100)
Else
table.SetFixedPosition(placeOnPage, 200, 250, 100)
End If


If placeOnPage = 0, then the table is printed correctly on the last page. If I set placeOnPage to values between 2 and 5, the table is correctly placed on page 2, 3, 4 or 5. But if I set placeOnPage to 1, I get an error at the line



doc.add(table)


The error says:



System.NullReferenceException: "object reference not set to an instance of an object"


I don´t know which object is NULL. Everythin else is exactly the same in all my tries....



Can anybody give me a hint?



Regards,



Benni



StackTrace:



   bei KernelExtensions.Get[TKey,TValue](IDictionary´2 col, TKey key)
bei iText.Kernel.Pdf.PdfDictionary.Get(PdfName key, Boolean asDirect)
bei iText.Kernel.Pdf.PdfDictionary.Get(PdfName key)
bei iText.Kernel.Pdf.PdfPage.GetContentStreamCount()
bei iText.Kernel.Pdf.PdfPage.GetLastContentStream()
bei iText.Kernel.Pdf.Canvas.PdfCanvas.GetPageStream(PdfPage page)
bei iText.Kernel.Pdf.Canvas.PdfCanvas..ctor(PdfPage page, Boolean wrapOldContent)
bei iText.Layout.Renderer.DocumentRenderer.FlushSingleRenderer(IRenderer resultRenderer)
bei iText.Layout.Renderer.RootRenderer.AddChild(IRenderer renderer)
bei iText.Layout.RootElement´1.CreateAndAddRendererSubTree(IElement element)
bei iText.Layout.RootElement´1.Add(IBlockElement element)
bei iText.Layout.Document.Add(IBlockElement element)
bei iTextPDF.class_iTextPDF.TableEnd() in D:Documents15 - Visual Studio ProjectsiTextPDFiTextPDFiTextPDF.vb:Zeile 1668.
bei iTextPDF.class_iTextPDF.addTextFrame(String text, String posLowerLeftPointFromLeft, String posLowerLeftPointFromBottom, String width, String height, PdfFont font, Single fontSize, Color fontColor, Single strokeWidth, Color strokeColor, Color fillColor, TextAlignment alignment, String innerSpacing, Int32 placeOnPage) in D:Documents15 - Visual Studio ProjectsiTextPDFiTextPDFiTextPDF.vb:Zeile 1360.
bei iTextPDFTest.Form1.Button1_Click(Object sender, EventArgs e) in D:Documents15 - Visual Studio ProjectsiTextPDFTestiTextPDFTestForm1.vb:Zeile 225.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.PerformClick()
bei iTextPDFTest.Form1.Form1_Load(Object sender, EventArgs e) in D:Documents15 - Visual Studio ProjectsiTextPDFTestiTextPDFTestForm1.vb:Zeile 9.
bei System.EventHandler.Invoke(Object sender, EventArgs e)
bei System.Windows.Forms.Form.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)






itext itext7






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 9:10







BeSt

















asked Nov 21 '18 at 12:55









BeStBeSt

84




84













  • "I don´t know which object is NULL" please show the stack trace of the error. Chances are, though, that the pdf in question and enough code to reproduce the error with it also are required to analyze the issue.

    – mkl
    Nov 21 '18 at 18:50











  • I added StackTrace to the question... (too lonr for comment)

    – BeSt
    Nov 22 '18 at 9:02











  • A NullReferenceException there sounds like the page dictionary object has already been released at the time this happens. iText usually attempts to flush generated pages to output as early as possible and then releases their data. Probably your code triggers that flushing before adding that table to page 1? To analyze this better more code is necessary.

    – mkl
    Nov 22 '18 at 10:47













  • Yes, this is shurely the reason. What I try is to add the table to the first page at the very end of the generation of the PDF document. The document finally has 5 pages, and just before doc.close I want to add the table to page 1. So this is not possible? And what about opening an existing document and adding a table to the first page?

    – BeSt
    Nov 22 '18 at 10:56





















  • "I don´t know which object is NULL" please show the stack trace of the error. Chances are, though, that the pdf in question and enough code to reproduce the error with it also are required to analyze the issue.

    – mkl
    Nov 21 '18 at 18:50











  • I added StackTrace to the question... (too lonr for comment)

    – BeSt
    Nov 22 '18 at 9:02











  • A NullReferenceException there sounds like the page dictionary object has already been released at the time this happens. iText usually attempts to flush generated pages to output as early as possible and then releases their data. Probably your code triggers that flushing before adding that table to page 1? To analyze this better more code is necessary.

    – mkl
    Nov 22 '18 at 10:47













  • Yes, this is shurely the reason. What I try is to add the table to the first page at the very end of the generation of the PDF document. The document finally has 5 pages, and just before doc.close I want to add the table to page 1. So this is not possible? And what about opening an existing document and adding a table to the first page?

    – BeSt
    Nov 22 '18 at 10:56



















"I don´t know which object is NULL" please show the stack trace of the error. Chances are, though, that the pdf in question and enough code to reproduce the error with it also are required to analyze the issue.

– mkl
Nov 21 '18 at 18:50





"I don´t know which object is NULL" please show the stack trace of the error. Chances are, though, that the pdf in question and enough code to reproduce the error with it also are required to analyze the issue.

– mkl
Nov 21 '18 at 18:50













I added StackTrace to the question... (too lonr for comment)

– BeSt
Nov 22 '18 at 9:02





I added StackTrace to the question... (too lonr for comment)

– BeSt
Nov 22 '18 at 9:02













A NullReferenceException there sounds like the page dictionary object has already been released at the time this happens. iText usually attempts to flush generated pages to output as early as possible and then releases their data. Probably your code triggers that flushing before adding that table to page 1? To analyze this better more code is necessary.

– mkl
Nov 22 '18 at 10:47







A NullReferenceException there sounds like the page dictionary object has already been released at the time this happens. iText usually attempts to flush generated pages to output as early as possible and then releases their data. Probably your code triggers that flushing before adding that table to page 1? To analyze this better more code is necessary.

– mkl
Nov 22 '18 at 10:47















Yes, this is shurely the reason. What I try is to add the table to the first page at the very end of the generation of the PDF document. The document finally has 5 pages, and just before doc.close I want to add the table to page 1. So this is not possible? And what about opening an existing document and adding a table to the first page?

– BeSt
Nov 22 '18 at 10:56







Yes, this is shurely the reason. What I try is to add the table to the first page at the very end of the generation of the PDF document. The document finally has 5 pages, and just before doc.close I want to add the table to page 1. So this is not possible? And what about opening an existing document and adding a table to the first page?

– BeSt
Nov 22 '18 at 10:56














1 Answer
1






active

oldest

votes


















0














This was a good hint. I set "immediateFlush" at the creation of "Document" to false. Then the page remains "editable" and I cant paste the table to the first page.






share|improve this answer
























  • But now I have another question following on the first: I open a existing PDF with this code snippet: reader = New PdfReader(filenameSource) writer = New PdfWriter(destFile) /// pdf = New PdfDocument(reader, writer) /// doc = New Document(pdf, pdf.GetDefaultPageSize, False) I can add a parapgrah now via doc.add(new Paragraph(...)) But when I try to place a table with table.setFixedPosition(...), the table doesn´t show on the page.

    – BeSt
    Nov 22 '18 at 11:30













  • "immediateFlush" - yes, this is what I would have proposed now. "But now I have another question" - please make that an actual new stack overflow question.

    – mkl
    Nov 22 '18 at 11:33











  • Alright. This thread is closed for the primary question.

    – BeSt
    Nov 22 '18 at 12:02











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412506%2fitext7-table-setfixedposition-on-page-1-fails%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This was a good hint. I set "immediateFlush" at the creation of "Document" to false. Then the page remains "editable" and I cant paste the table to the first page.






share|improve this answer
























  • But now I have another question following on the first: I open a existing PDF with this code snippet: reader = New PdfReader(filenameSource) writer = New PdfWriter(destFile) /// pdf = New PdfDocument(reader, writer) /// doc = New Document(pdf, pdf.GetDefaultPageSize, False) I can add a parapgrah now via doc.add(new Paragraph(...)) But when I try to place a table with table.setFixedPosition(...), the table doesn´t show on the page.

    – BeSt
    Nov 22 '18 at 11:30













  • "immediateFlush" - yes, this is what I would have proposed now. "But now I have another question" - please make that an actual new stack overflow question.

    – mkl
    Nov 22 '18 at 11:33











  • Alright. This thread is closed for the primary question.

    – BeSt
    Nov 22 '18 at 12:02
















0














This was a good hint. I set "immediateFlush" at the creation of "Document" to false. Then the page remains "editable" and I cant paste the table to the first page.






share|improve this answer
























  • But now I have another question following on the first: I open a existing PDF with this code snippet: reader = New PdfReader(filenameSource) writer = New PdfWriter(destFile) /// pdf = New PdfDocument(reader, writer) /// doc = New Document(pdf, pdf.GetDefaultPageSize, False) I can add a parapgrah now via doc.add(new Paragraph(...)) But when I try to place a table with table.setFixedPosition(...), the table doesn´t show on the page.

    – BeSt
    Nov 22 '18 at 11:30













  • "immediateFlush" - yes, this is what I would have proposed now. "But now I have another question" - please make that an actual new stack overflow question.

    – mkl
    Nov 22 '18 at 11:33











  • Alright. This thread is closed for the primary question.

    – BeSt
    Nov 22 '18 at 12:02














0












0








0







This was a good hint. I set "immediateFlush" at the creation of "Document" to false. Then the page remains "editable" and I cant paste the table to the first page.






share|improve this answer













This was a good hint. I set "immediateFlush" at the creation of "Document" to false. Then the page remains "editable" and I cant paste the table to the first page.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 '18 at 11:29









BeStBeSt

84




84













  • But now I have another question following on the first: I open a existing PDF with this code snippet: reader = New PdfReader(filenameSource) writer = New PdfWriter(destFile) /// pdf = New PdfDocument(reader, writer) /// doc = New Document(pdf, pdf.GetDefaultPageSize, False) I can add a parapgrah now via doc.add(new Paragraph(...)) But when I try to place a table with table.setFixedPosition(...), the table doesn´t show on the page.

    – BeSt
    Nov 22 '18 at 11:30













  • "immediateFlush" - yes, this is what I would have proposed now. "But now I have another question" - please make that an actual new stack overflow question.

    – mkl
    Nov 22 '18 at 11:33











  • Alright. This thread is closed for the primary question.

    – BeSt
    Nov 22 '18 at 12:02



















  • But now I have another question following on the first: I open a existing PDF with this code snippet: reader = New PdfReader(filenameSource) writer = New PdfWriter(destFile) /// pdf = New PdfDocument(reader, writer) /// doc = New Document(pdf, pdf.GetDefaultPageSize, False) I can add a parapgrah now via doc.add(new Paragraph(...)) But when I try to place a table with table.setFixedPosition(...), the table doesn´t show on the page.

    – BeSt
    Nov 22 '18 at 11:30













  • "immediateFlush" - yes, this is what I would have proposed now. "But now I have another question" - please make that an actual new stack overflow question.

    – mkl
    Nov 22 '18 at 11:33











  • Alright. This thread is closed for the primary question.

    – BeSt
    Nov 22 '18 at 12:02

















But now I have another question following on the first: I open a existing PDF with this code snippet: reader = New PdfReader(filenameSource) writer = New PdfWriter(destFile) /// pdf = New PdfDocument(reader, writer) /// doc = New Document(pdf, pdf.GetDefaultPageSize, False) I can add a parapgrah now via doc.add(new Paragraph(...)) But when I try to place a table with table.setFixedPosition(...), the table doesn´t show on the page.

– BeSt
Nov 22 '18 at 11:30







But now I have another question following on the first: I open a existing PDF with this code snippet: reader = New PdfReader(filenameSource) writer = New PdfWriter(destFile) /// pdf = New PdfDocument(reader, writer) /// doc = New Document(pdf, pdf.GetDefaultPageSize, False) I can add a parapgrah now via doc.add(new Paragraph(...)) But when I try to place a table with table.setFixedPosition(...), the table doesn´t show on the page.

– BeSt
Nov 22 '18 at 11:30















"immediateFlush" - yes, this is what I would have proposed now. "But now I have another question" - please make that an actual new stack overflow question.

– mkl
Nov 22 '18 at 11:33





"immediateFlush" - yes, this is what I would have proposed now. "But now I have another question" - please make that an actual new stack overflow question.

– mkl
Nov 22 '18 at 11:33













Alright. This thread is closed for the primary question.

– BeSt
Nov 22 '18 at 12:02





Alright. This thread is closed for the primary question.

– BeSt
Nov 22 '18 at 12:02


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412506%2fitext7-table-setfixedposition-on-page-1-fails%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Create new schema in PostgreSQL using DBeaver

Deepest pit of an array with Javascript: test on Codility

Fotorealismo