After I rotated pdf file a few times, the content in document had missing when view on Chrome browser.
//open document
var pageEditor = new PdfPageEditor();
var doc = new Document(source);
pageEditor.BindPdf(doc);
//set page rotations
var pageRotations = new Dictionary<int, int>();
for (var i = 1; i <= doc.Pages.Count; i++)
{
pageRotations.Add(i, rotation);
}
pageEditor.PageRotations = pageRotations;
//save updated PDF file
using (var destination = new MemoryStream())
{
pageEditor.Save(destination);
return destination.ToArray();
}
Original file & rotated file: https://we.tl/U0gKq8dXlD