@@ -214,8 +214,6 @@ PdfTemplate template = loadedPage.CreateTemplate();
214214
215215//Create a new PDF document.
216216PdfDocument document = new PdfDocument();
217- //Set the document margin.
218- document.PageSettings.SetMargins(2);
219217//Add the page.
220218PdfPage page = document.Pages.Add();
221219//Create the graphics.
@@ -225,8 +223,9 @@ graphics.DrawPdfTemplate(template, Syncfusion.Drawing.PointF.Empty, new Syncfusi
225223
226224//Save the document into stream.
227225MemoryStream stream = new MemoryStream();
228- loadedDocument .Save(stream);
226+ document .Save(stream);
229227//Close the document.
228+ document.Close(true);
230229loadedDocument.Close(true);
231230
232231{% endhighlight %}
@@ -242,8 +241,6 @@ PdfTemplate template = loadedPage.CreateTemplate();
242241
243242//Create a new PDF document.
244243PdfDocument document = new PdfDocument();
245- //Set the document margin.
246- document.PageSettings.SetMargins(2);
247244//Add the page.
248245PdfPage page = document.Pages.Add();
249246//Create the graphics.
@@ -270,8 +267,6 @@ Dim template As PdfTemplate = loadedPage.CreateTemplate()
270267
271268'Create a new PDF document
272269Dim document As New PdfDocument()
273- 'Set the document margin
274- document.PageSettings.SetMargins(2)
275270'Add the page
276271Dim page As PdfPage = document.Pages.Add()
277272'Create the graphics
0 commit comments