Skip to content

Commit 61fd1d6

Browse files
authored
Merge pull request #1615 from syncfusion-content/988621-ug1
988621-ug1: Resolved build failures in UG documentation
2 parents d945f17 + b308cb3 commit 61fd1d6

File tree

1 file changed

+60
-16
lines changed

1 file changed

+60
-16
lines changed

Document-Processing/PDF/PDF-Library/NET/Working-with-Flow-Layout.md

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);
9090
render.Dispose();
9191
wordDocument.Dispose();
9292

93-
//Save the document into stream.
94-
MemoryStream stream = new MemoryStream();
95-
pdfDocument.Save(stream);
96-
//Close the documents.
93+
//Save and close the PDF document.
94+
pdfDocument.Save("Output.pdf");
9795
pdfDocument.Close(true);
96+
//Close the document.
97+
wordDocument.Close();
9898
{% endhighlight %}
9999

100100
{% highlight c# tabtitle="C# [Windows-specific]" %}
@@ -180,6 +180,11 @@ You can create PDF document with text and image using the following code snippet
180180

181181
{% tabs %}
182182
{% highlight c# tabtitle="C# [Cross-platform]" %}
183+
184+
using Syncfusion.Pdf;
185+
using Syncfusion.DocIO.DLS;
186+
using Syncfusion.DocToPDFConverter;
187+
183188
//A new document is created.
184189
WordDocument document = new WordDocument();
185190
//Adding a new section to the document.
@@ -230,15 +235,18 @@ PdfDocument pdfDocument = render.ConvertToPDF(document);
230235
render.Dispose();
231236
document.Dispose();
232237

233-
//Save the document into stream.
234-
MemoryStream stream = new MemoryStream();
235-
pdfDocument.Save(stream);
236-
//Close the documents.
238+
//Saves the PDF file.
239+
pdfDocument.Save("Sample.pdf");
237240
pdfDocument.Close(true);
241+
document.Close();
238242
{% endhighlight %}
239243

240244
{% highlight c# tabtitle="C# [Windows-specific]" %}
241245

246+
using Syncfusion.Pdf;
247+
using Syncfusion.DocIO.DLS;
248+
using Syncfusion.DocToPDFConverter;
249+
242250
//A new document is created.
243251
WordDocument document = new WordDocument();
244252
//Adding a new section to the document.
@@ -293,6 +301,11 @@ document.Close();
293301
{% endhighlight %}
294302

295303
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
304+
305+
Imports Syncfusion.DocIO.DLS
306+
Imports Syncfusion.DocToPDFConverter
307+
Imports Syncfusion.Pdf
308+
296309
'A new document is created
297310
Dim document As New WordDocument()
298311
'Adding a new section to the document
@@ -355,6 +368,11 @@ You can create PDF document with simple table using the following code snippet.
355368

356369
{% tabs %}
357370
{% highlight c# tabtitle="C# [Cross-platform]" %}
371+
372+
using Syncfusion.Pdf;
373+
using Syncfusion.DocIO.DLS;
374+
using Syncfusion.DocToPDFConverter;
375+
358376
//Creates a new Word document.
359377
WordDocument wordDocument = new WordDocument();
360378
//Adding a new section to the document.
@@ -424,15 +442,19 @@ PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);
424442
render.Dispose();
425443
wordDocument.Dispose();
426444

427-
//Save the document into stream.
428-
MemoryStream stream = new MemoryStream();
429-
pdfDocument.Save(stream);
430-
//Close the documents.
445+
//Save and close the PDF document.
446+
pdfDocument.Save("Output.pdf");
431447
pdfDocument.Close(true);
448+
//Close the document.
449+
wordDocument.Close();
432450
{% endhighlight %}
433451

434452
{% highlight c# tabtitle="C# [Windows-specific]" %}
435453

454+
using Syncfusion.Pdf;
455+
using Syncfusion.DocIO.DLS;
456+
using Syncfusion.DocToPDFConverter;
457+
436458
//Creates a new Word document.
437459
WordDocument wordDocument = new WordDocument();
438460
//Adding a new section to the document.
@@ -508,6 +530,11 @@ wordDocument.Close();
508530
{% endhighlight %}
509531

510532
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
533+
534+
Imports Syncfusion.DocIO.DLS
535+
Imports Syncfusion.DocToPDFConverter
536+
Imports Syncfusion.Pdf
537+
511538
'Creates a new Word document
512539
Dim wordDocument As New WordDocument()
513540
'Adding a new section to the document
@@ -593,7 +620,13 @@ Syncfusion Essential<sup>&reg;</sup> PDF supports creating a PDF document with f
593620
The following code snippet explains how to create a PDF document with image, paragraph text, header text, a line below the header text, and a table using flow model.
594621

595622
{% tabs %}
596-
{% highlight c# tabtitle="C#" %}
623+
{% highlight c# tabtitle="C# [Cross-platform]" %}
624+
625+
using Syncfusion.Drawing;
626+
using Syncfusion.Pdf;
627+
using Syncfusion.Pdf.Graphics;
628+
using Syncfusion.Pdf.Grid;
629+
597630
//Create a new PDF document.
598631
PdfDocument document = new PdfDocument();
599632
//Add a page to the document.
@@ -650,15 +683,20 @@ grid.ApplyBuiltinStyle(PdfGridBuiltinStyle.GridTable5DarkAccent5);
650683
//Draw the table in page, below the line with a height gap of 20.
651684
grid.Draw(page, new PointF(0, layoutResult.Bounds.Bottom + 20));
652685

653-
//Saving the PDF to the MemoryStream.
654-
MemoryStream stream = new MemoryStream();
655-
document.Save(stream);
686+
//Save the PDF document.
687+
document.Save("Output.pdf");
656688
//Close the instance of PdfDocument.
657689
document.Close(true);
690+
658691
{% endhighlight %}
659692

660693
{% highlight c# tabtitle="C# [Windows-specific]" %}
661694

695+
using System.Drawing;
696+
using Syncfusion.Pdf;
697+
using Syncfusion.Pdf.Graphics;
698+
using Syncfusion.Pdf.Grid;
699+
662700
//Create a new PDF document.
663701
PdfDocument document = new PdfDocument();
664702
//Add a page to the document.
@@ -722,6 +760,12 @@ document.Close(true);
722760
{% endhighlight %}
723761

724762
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
763+
764+
Imports System.Drawing
765+
Imports Syncfusion.Pdf
766+
Imports Syncfusion.Pdf.Graphics
767+
Imports Syncfusion.Pdf.Grid
768+
725769
'Create a new PDF document
726770
Dim document As PdfDocument = New PdfDocument
727771
'Add a page to the document

0 commit comments

Comments
 (0)