Skip to content

Commit 03bb9c7

Browse files
committed the file stream changes for pptx to pdf conversion
1 parent feb9504 commit 03bb9c7

23 files changed

Lines changed: 34 additions & 34 deletions

File tree

  • PPTX-to-PDF-conversion
    • Apply-substitution-font-name/.NET/Apply-substitution-font-name
    • Apply-substitution-font-stream/.NET/Apply-substitution-font-stream
    • Convert-PowerPoint-into-accessible-PDF/.NET/Convert-PowerPoint-into-accessible-PDF
    • Convert-PowerPoint-presentation-to-PDF
      • .NET/Convert-PowerPoint-presentation-to-PDF
      • ASP.NET-Core-Web-API/Client Application/Client Application
      • Azure/Azure_Functions/Console_App_Flex_Consumption/PPTX-to-PDF
    • Convert-PowerPoint-to-PDF-with-handouts/.NET-Framework/Convert-PowerPoint-to-PDF-with-handouts
    • Convert-PowerPoint-to-PDF-with-notes/.NET-Framework/Convert-PowerPoint-to-PDF-with-notes
    • Create-fillable-PDF-from-PPTX/.NET/Create-fillable-PDF-from-PPTX
    • Enable-portable-rendering/.NET-Framework/Enable-portable-rendering
    • Fallback-fonts-based-on-scripttype/.NET/Fallback-fonts-based-on-scripttype
    • Fallback-fonts-for-Unicode-range/.NET/Fallback-fonts-for-Unicode-range
    • Fallback-symbols-based-on-scripttype/.NET/Fallback-symbols-based-on-scripttype
    • Initialize-default-fallback-fonts/.NET/Initialize-default-fallback-fonts
    • Modify-the-exiting-fallback-fonts/.NET/Modify-the-exiting-fallback-fonts
    • Optimize-duplicate-images/.NET-Framework/Optimize-duplicate-images
    • Optimize-image-quality-and-resolution/.NET-Framework/Optimize-image-quality-and-resolution
    • PowerPoint-to-PDF-with-hidden-slides/.NET-Framework/PowerPoint-to-PDF-with-hidden-slides
    • PowerPoint-to-PDF-with-nested-metafile/.NET-Framework/PowerPoint-to-PDF-with-nested-metafile
    • Set-PDF-conformance-level
    • Set-chart-quality/.NET-Framework/Set-chart-quality
    • Show-warning-for-unsupported-elements/.NET/Show-warning-for-unsupported-elements

PPTX-to-PDF-conversion/Apply-substitution-font-name/.NET/Apply-substitution-font-name/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
using Syncfusion.PresentationRenderer;
44

55
//Load the PowerPoint presentation.
6-
using (IPresentation pptxDoc = Presentation.Open(@"Data/Template.pptx"))
6+
using (IPresentation pptxDoc = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx")))
77
{
88
//Initialize the SubstituteFont event to set the replacement font.
99
pptxDoc.FontSettings.SubstituteFont += SubstituteFont;
1010
//Convert the PowerPoint presentation to PDF document.
1111
using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc))
1212
{
1313
//Save the generated PDF to the file system.
14-
pdfDocument.Save(@"Output/PPTXToPDF.pdf");
14+
pdfDocument.Save(Path.GetFullPath(@"Output/PPTXToPDF.pdf"));
1515
//Release all resources.
1616
pdfDocument.Close(true);
1717
}

PPTX-to-PDF-conversion/Apply-substitution-font-stream/.NET/Apply-substitution-font-stream/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
using Syncfusion.PresentationRenderer;
55

66
//Load the PowerPoint presentation.
7-
using (IPresentation pptxDoc = Presentation.Open(@"Data/Template.pptx"))
7+
using (IPresentation pptxDoc = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx")))
88
{
99
//Initialize the SubstituteFont event to set the replacement font.
1010
pptxDoc.FontSettings.SubstituteFont += SubstituteFont;
1111
//Convert the PowerPoint presentation to PDF document.
1212
using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc))
1313
{
1414
//Save the generated PDF to the file system.
15-
pdfDocument.Save(@"Output/PPTXToPDF.pdf");
15+
pdfDocument.Save(Path.GetFullPath(@"Output/PPTXToPDF.pdf"));
1616
//Release all resources.
1717
pdfDocument.Close(true);
1818
}

PPTX-to-PDF-conversion/Convert-PowerPoint-into-accessible-PDF/.NET/Convert-PowerPoint-into-accessible-PDF/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Syncfusion.PresentationRenderer;
44

55
//Open the existing PowerPoint presentation.
6-
using (IPresentation pptxDoc = Presentation.Open(@"Data/Template.pptx"))
6+
using (IPresentation pptxDoc = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx")))
77
{
88
//Instantiate PresentationToPdfConverterSettings.
99
PresentationToPdfConverterSettings pdfConverterSettings = new PresentationToPdfConverterSettings();
@@ -13,6 +13,6 @@
1313
using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc, pdfConverterSettings))
1414
{
1515
//Save the PDF document to the file system.
16-
pdfDocument.Save(@"Output/PPTXToPDF.pdf");
16+
pdfDocument.Save(Path.GetFullPath(@"Output/PPTXToPDF.pdf"));
1717
}
1818
}

PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/.NET/Convert-PowerPoint-presentation-to-PDF/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
using Syncfusion.PresentationRenderer;
44

55
//Open the existing PowerPoint presentation.
6-
using (IPresentation pptxDoc = Presentation.Open(Path.GetFullPath("Data/Template.pptx")))
6+
using (IPresentation pptxDoc = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx")))
77
{
88
//Convert the PowerPoint presentation to PDF document.
99
using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc))
1010
{
1111
//Save the PDF document to the file system.
12-
pdfDocument.Save(@"Output\PPTXToPDF.pdf");
12+
pdfDocument.Save(Path.GetFullPath(@"Output/PPTXToPDF.pdf"));
1313
}
1414
}

PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/ASP.NET-Core-Web-API/Client Application/Client Application/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static async Task Main(string[] args)
1515
{
1616
// Read the content as a string
1717
Stream responseBody = await response.Content.ReadAsStreamAsync();
18-
FileStream fileStream = File.Create("../../../Output/Output.pdf");
18+
FileStream fileStream = File.Create(@"../../../Output/Output.pdf");
1919
responseBody.CopyTo(fileStream);
2020
fileStream.Close();
2121
}

PPTX-to-PDF-conversion/Convert-PowerPoint-presentation-to-PDF/Azure/Azure_Functions/Console_App_Flex_Consumption/PPTX-to-PDF/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static async Task Main()
1515
// Create a new HttpClient instance for sending requests
1616
using var http = new HttpClient();
1717
// Read all bytes from the input PowerPoint Presentation file
18-
var bytes = await File.ReadAllBytesAsync(@"Data/Input.pptx");
18+
var bytes = await File.ReadAllBytesAsync(Path.GetFullPath(@"Data/Input.pptx"));
1919
// Create HTTP content from the document bytes
2020
using var content = new ByteArrayContent(bytes);
2121
// Set the content type header to application/octet-stream (binary data)

PPTX-to-PDF-conversion/Convert-PowerPoint-to-PDF-with-handouts/.NET-Framework/Convert-PowerPoint-to-PDF-with-handouts/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void Main()
2626
using (PdfDocument pdfDoc = PresentationToPdfConverter.Convert(pptxDoc, pdfConverterSettings))
2727
{
2828
//Save the converted PDF document.
29-
pdfDoc.Save("../../PPTXToPDF.pdf");
29+
pdfDoc.Save(@"../../PPTXToPDF.pdf");
3030
}
3131
}
3232
}

PPTX-to-PDF-conversion/Convert-PowerPoint-to-PDF-with-notes/.NET-Framework/Convert-PowerPoint-to-PDF-with-notes/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static void Main()
2727
using (PdfDocument pdfDoc = PresentationToPdfConverter.Convert(pptxDoc, pdfConverterSettings))
2828
{
2929
//Save the converted PDF document.
30-
pdfDoc.Save("../../PPTXToPDF.pdf");
30+
pdfDoc.Save(@"../../PPTXToPDF.pdf");
3131
}
3232
}
3333
}

PPTX-to-PDF-conversion/Create-fillable-PDF-from-PPTX/.NET/Create-fillable-PDF-from-PPTX/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Syncfusion.PresentationRenderer;
44

55
//Open the existing PowerPoint presentation.
6-
using (IPresentation pptxDoc = Presentation.Open(@"Data/Template.pptx"))
6+
using (IPresentation pptxDoc = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx")))
77
{
88
//Instantiate PresentationToPdfConverterSettings.
99
PresentationToPdfConverterSettings settings = new PresentationToPdfConverterSettings();
@@ -13,6 +13,6 @@
1313
using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc))
1414
{
1515
//Save the PDF document to the file system.
16-
pdfDocument.Save(@"Output/PPTXToPDF.pdf");
16+
pdfDocument.Save(Path.GetFullPath(@"Output/PPTXToPDF.pdf"));
1717
}
1818
}

PPTX-to-PDF-conversion/Enable-portable-rendering/.NET-Framework/Enable-portable-rendering/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void Main()
2626
using (PdfDocument pdfDoc = PresentationToPdfConverter.Convert(pptxDoc, pdfConverterSettings))
2727
{
2828
//Save the converted PDF document.
29-
pdfDoc.Save("../../PPTXToPDF.pdf");
29+
pdfDoc.Save(@"../../PPTXToPDF.pdf");
3030
}
3131
}
3232
}

0 commit comments

Comments
 (0)