diff --git a/Actions/Adding-Document-Level JavaScript-Actions/.NET/Adding-Document-Level JavaScript-Actions/Program.cs b/Actions/Adding-Document-Level JavaScript-Actions/.NET/Adding-Document-Level JavaScript-Actions/Program.cs index 71aa71a6..f8126e65 100644 --- a/Actions/Adding-Document-Level JavaScript-Actions/.NET/Adding-Document-Level JavaScript-Actions/Program.cs +++ b/Actions/Adding-Document-Level JavaScript-Actions/.NET/Adding-Document-Level JavaScript-Actions/Program.cs @@ -17,7 +17,7 @@ javaScriptCollection.Add(javaScriptAction); // Save the PDF document using a file stream. -using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output\Output.pdf"), FileMode.Create, FileAccess.Write)) +using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.Write)) { document.Save(fileStream); } diff --git a/Actions/Remove-Document-Level-JavaScript-Actions/.NET/Remove-Document-Level-JavaScript-Actions/Program.cs b/Actions/Remove-Document-Level-JavaScript-Actions/.NET/Remove-Document-Level-JavaScript-Actions/Program.cs index ec93f0b3..23c14f97 100644 --- a/Actions/Remove-Document-Level-JavaScript-Actions/.NET/Remove-Document-Level-JavaScript-Actions/Program.cs +++ b/Actions/Remove-Document-Level-JavaScript-Actions/.NET/Remove-Document-Level-JavaScript-Actions/Program.cs @@ -4,7 +4,7 @@ using Syncfusion.Pdf; //Load an existing PDF document using a file stream -using (FileStream inputStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) +using (FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) using (PdfLoadedDocument document = new PdfLoadedDocument(inputStream)) { //Retrieve the JavaScript collection from the document @@ -17,7 +17,7 @@ javaScriptCollection.Remove(javaScriptAction); //Save the modified document using a file stream - using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output\Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) + using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) { document.Save(outputStream); } diff --git a/Actions/Retrieve-Document-Level-JavaScript-Actions/.NET/Retrieve-Document-Level-JavaScript-Actions/Program.cs b/Actions/Retrieve-Document-Level-JavaScript-Actions/.NET/Retrieve-Document-Level-JavaScript-Actions/Program.cs index 596ab326..076e4dae 100644 --- a/Actions/Retrieve-Document-Level-JavaScript-Actions/.NET/Retrieve-Document-Level-JavaScript-Actions/Program.cs +++ b/Actions/Retrieve-Document-Level-JavaScript-Actions/.NET/Retrieve-Document-Level-JavaScript-Actions/Program.cs @@ -3,7 +3,7 @@ using Syncfusion.Pdf.Parsing; //Load an existing PDF document using a file stream -using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) +using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) using (PdfLoadedDocument document = new PdfLoadedDocument(fileStream)) { //Retrieve the JavaScript collection from the loaded document diff --git a/Annotation/Exporting-Newly-Added-Annotations-FDF-File/.NET/Exporting-Newly-Added-Annotations-FDF-File/Program.cs b/Annotation/Exporting-Newly-Added-Annotations-FDF-File/.NET/Exporting-Newly-Added-Annotations-FDF-File/Program.cs index 18d6101f..69bb4408 100644 --- a/Annotation/Exporting-Newly-Added-Annotations-FDF-File/.NET/Exporting-Newly-Added-Annotations-FDF-File/Program.cs +++ b/Annotation/Exporting-Newly-Added-Annotations-FDF-File/.NET/Exporting-Newly-Added-Annotations-FDF-File/Program.cs @@ -5,7 +5,7 @@ using Syncfusion.Pdf.Parsing; //Load the PDF document from a file stream -using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) +using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) using (PdfLoadedDocument pdfLoadedDocument = new PdfLoadedDocument(docStream)) { //Create a PDF free text annotation @@ -23,7 +23,7 @@ pdfLoadedDocument.Pages[0].Annotations.Add(freeText); //Export annotations to the FDF format and save to a file using a file stream - using (FileStream fdfFileStream = new FileStream(Path.GetFullPath(@"Output\Output.fdf"), FileMode.Create, FileAccess.Write)) + using (FileStream fdfFileStream = new FileStream(Path.GetFullPath(@"Output/Output.fdf"), FileMode.Create, FileAccess.Write)) { pdfLoadedDocument.ExportAnnotations(fdfFileStream, AnnotationDataFormat.Fdf); } diff --git a/Annotation/Exporting-Newly-Added-Annotations-JSON-File/.NET/Exporting-Newly-Added-Annotations-JSON-File/Program.cs b/Annotation/Exporting-Newly-Added-Annotations-JSON-File/.NET/Exporting-Newly-Added-Annotations-JSON-File/Program.cs index 34bc3aea..edd0cb08 100644 --- a/Annotation/Exporting-Newly-Added-Annotations-JSON-File/.NET/Exporting-Newly-Added-Annotations-JSON-File/Program.cs +++ b/Annotation/Exporting-Newly-Added-Annotations-JSON-File/.NET/Exporting-Newly-Added-Annotations-JSON-File/Program.cs @@ -4,7 +4,7 @@ using Syncfusion.Pdf.Parsing; //Load the PDF document from a file stream -using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) +using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) using (PdfLoadedDocument pdfLoadedDocument = new PdfLoadedDocument(docStream)) { //Create a PDF free text annotation @@ -22,7 +22,7 @@ pdfLoadedDocument.Pages[0].Annotations.Add(freeText); //Export annotations to the JSON format and save to a file using a file stream - using (FileStream jsonFileStream = new FileStream(Path.GetFullPath(@"Output\Output.json"), FileMode.Create, FileAccess.Write)) + using (FileStream jsonFileStream = new FileStream(Path.GetFullPath(@"Output/Output.json"), FileMode.Create, FileAccess.Write)) { pdfLoadedDocument.ExportAnnotations(jsonFileStream, AnnotationDataFormat.Json); } diff --git a/Annotation/Exporting-Newly-Added-Annotations-XFDF-File/.NET/Exporting-Newly-Added-Annotations-XFDF-File/Program.cs b/Annotation/Exporting-Newly-Added-Annotations-XFDF-File/.NET/Exporting-Newly-Added-Annotations-XFDF-File/Program.cs index 1f9660ec..b1dcf47f 100644 --- a/Annotation/Exporting-Newly-Added-Annotations-XFDF-File/.NET/Exporting-Newly-Added-Annotations-XFDF-File/Program.cs +++ b/Annotation/Exporting-Newly-Added-Annotations-XFDF-File/.NET/Exporting-Newly-Added-Annotations-XFDF-File/Program.cs @@ -4,7 +4,7 @@ using Syncfusion.Pdf.Parsing; //Load the PDF document from a file stream -using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) +using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) using (PdfLoadedDocument pdfLoadedDocument = new PdfLoadedDocument(docStream)) { //Create a PDF free text annotation @@ -22,7 +22,7 @@ pdfLoadedDocument.Pages[0].Annotations.Add(freeText); //Export annotations to the XFDF format and save to a file using a file stream - using (FileStream xfdfFileStream = new FileStream(Path.GetFullPath(@"Output\Output.xfdf"), FileMode.Create, FileAccess.Write)) + using (FileStream xfdfFileStream = new FileStream(Path.GetFullPath(@"Output/Output.xfdf"), FileMode.Create, FileAccess.Write)) { pdfLoadedDocument.ExportAnnotations(xfdfFileStream, AnnotationDataFormat.XFdf); } diff --git a/Annotation/Flatten-specific-types-of-annotations/.NET/Flatten-specific-types-of-annotations/Program.cs b/Annotation/Flatten-specific-types-of-annotations/.NET/Flatten-specific-types-of-annotations/Program.cs index f49d3b52..7e69cb47 100644 --- a/Annotation/Flatten-specific-types-of-annotations/.NET/Flatten-specific-types-of-annotations/Program.cs +++ b/Annotation/Flatten-specific-types-of-annotations/.NET/Flatten-specific-types-of-annotations/Program.cs @@ -2,7 +2,7 @@ using Syncfusion.Pdf.Parsing; //Load the PDF document using a file stream -using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) +using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) { //Load the existing PDF document using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream)) @@ -17,7 +17,7 @@ loadedDocument.FlattenAnnotations(pdfLoadedAnnotationTypes); //Save the flattened document using a file stream - using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output\Output.pdf"), FileMode.Create, FileAccess.Write)) + using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.Write)) { loadedDocument.Save(outputStream); } diff --git a/Annotation/Set-text-alignment-in-a-Combo-Box-field/.NET/Set-text-alignment-in-a-Combo-Box-field/Program.cs b/Annotation/Set-text-alignment-in-a-Combo-Box-field/.NET/Set-text-alignment-in-a-Combo-Box-field/Program.cs index 4b5923e8..b23e8bf0 100644 --- a/Annotation/Set-text-alignment-in-a-Combo-Box-field/.NET/Set-text-alignment-in-a-Combo-Box-field/Program.cs +++ b/Annotation/Set-text-alignment-in-a-Combo-Box-field/.NET/Set-text-alignment-in-a-Combo-Box-field/Program.cs @@ -2,7 +2,7 @@ using Syncfusion.Pdf.Parsing; // Load an existing document from a file stream. -using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) +using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) { PdfLoadedDocument doc = new PdfLoadedDocument(fileStream); // Load an existing combo box field by its name. @@ -11,7 +11,7 @@ comboField.TextAlignment = PdfTextAlignment.Center; // Save the updated document to a file stream. - using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output\Output.pdf"), FileMode.Create, FileAccess.Write)) + using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.Write)) { doc.Save(outputStream); } diff --git a/Digital Signature/Customize-the-signed-date/.NET/Customize-the-signed-date/Program.cs b/Digital Signature/Customize-the-signed-date/.NET/Customize-the-signed-date/Program.cs index 5d7427f2..e9b53e70 100644 --- a/Digital Signature/Customize-the-signed-date/.NET/Customize-the-signed-date/Program.cs +++ b/Digital Signature/Customize-the-signed-date/.NET/Customize-the-signed-date/Program.cs @@ -15,7 +15,7 @@ //Define the bounds for the signature (position and size on the page). signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(200, 100)); //Save the document to a file using a file stream. -using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output\Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) +using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) { document.Save(fileStream); } diff --git a/HTML to PDF/Blink/HTML-to-PDF-Enable-Autoscaling/.NET/HTML-to-PDF-Enable-Autoscaling/Program.cs b/HTML to PDF/Blink/HTML-to-PDF-Enable-Autoscaling/.NET/HTML-to-PDF-Enable-Autoscaling/Program.cs index cf07781b..cd4eb597 100644 --- a/HTML to PDF/Blink/HTML-to-PDF-Enable-Autoscaling/.NET/HTML-to-PDF-Enable-Autoscaling/Program.cs +++ b/HTML to PDF/Blink/HTML-to-PDF-Enable-Autoscaling/.NET/HTML-to-PDF-Enable-Autoscaling/Program.cs @@ -5,6 +5,12 @@ HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); // Initialize BlinkConverterSettings to configure the Blink rendering engine. BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings(); +if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) +{ + //Set command line arugument to run without the sandbox. + blinkConverterSettings.CommandLineArguments.Add("--no-sandbox"); + blinkConverterSettings.CommandLineArguments.Add("--disable-setuid-sandbox"); +} // Enables automatic scaling to adjust the HTML content to fit the PDF's dimensions. blinkConverterSettings.EnableAutoScaling = true; @@ -12,9 +18,9 @@ // Assigns the Blink settings to the HTML to PDF converter. htmlConverter.ConverterSettings = blinkConverterSettings; // Converts the HTML file to a PDF document, using the path of the HTML file. -PdfDocument document = htmlConverter.Convert(Path.GetFullPath(@"Data\Input.html")); +PdfDocument document = htmlConverter.Convert(Path.GetFullPath(@"Data/Input.html")); // Save the generated PDF document to a specified output file. -using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output\Output.pdf"), FileMode.Create)) +using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create)) { document.Save(fileStream); }