How do i achieve this progress bar in pdf generator

Please help me on how to achieve this example picture

Attachment: Screenshot_20210526_160124_2707c7a0.rar

1 Reply 1 reply marked as answer

GK Gowthamraj Kumar Syncfusion Team May 27, 2021 10:57 AM UTC

Hi Leonardo, 
 
Thank you for contacting Syncfusion support. 
 
We can able to get the progress status of pdf document by using SaveProgress event. This event raised on saving the document. It will keep track of the save progress of the document. We have attached the code snippet and screenshot of progress result. Kindly please try this on your end and let us know if it is suites your requirement or not. 
 
Please refer the below link for more information, 
 
//Create a new PDF document. 
PdfDocument document = new PdfDocument(); 
//Add new pages to the document. 
PdfPage page = document.Pages.Add(); 
//Create font and font style. 
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold); 
//Draw text in the new page. 
page.Graphics.DrawString("Essential PDF", font, PdfBrushes.Black, new PointF(10, 10)); 
document.SaveProgress += new PdfDocument.ProgressEventHandler(document_SaveProgress); 
//Save the document 
MemoryStream stream = new MemoryStream(); 
document.Save(stream); 
document.Close(true); 
 
stream.Position = 0; 
FileStream outStream = File.OpenWrite("Sample_Saveprogess.pdf"); 
stream.WriteTo(outStream); 
outStream.Flush(); 
stream.Dispose(); 
} 
 
// Event handler for PageAdded event 
public static void document_SaveProgress(object sender, ProgressEventArgs arguments) 
{ 
   Console.WriteLine(String.Format("Current: {0}, Progress: {1}, Total {2}", arguments.Current, arguments.Progress, arguments.Total)); 
} 
 
Please find the screenshot for save progress of PDF document, 
 
 
Please let us know if you need any further assistance on this.  
 
Regards, 
Gowthamraj K 


Marked as answer
Loader.
Up arrow icon