Hi,
you can see in your code your are adding a QR code to per page inside the for loop. shouldn't this be something like this:
foreach (Document inputDocument in Documents)
{
string gurl = "";
string gocr = "";
PdfSharp.Drawing.XGraphics gfx;
for (int idx = 0; idx < inputDocument.PageCount; idx++)
{
using (var dc = new DataContext())
{
Assessment a;
a = dc.Assessments.FirstOrDefault(
c => c.DocumentID == d.ID && c.FeedbackUserID == u.ID && c.PageNumber == idx + 1);
if (a == null)
{
a = new Assessment()
{
DocumentID = d.ID,
FeedbackUserID = u.ID,
PageNumber = idx + 1,
ID = Guid.NewGuid()
};
}
a.LastGeneratedDT = DateTime.UtcNow;
dc.SubmitChanges();
PdfSharp.Pdf.PdfPage newpg = outputDocument.AddPage(inputDocument.Pages[idx]);
gfx = PdfSharp.Drawing.XGraphics.FromPdfPage(newpg);
string gurl = a.ID.ToString().Replace("-", "");
string gocr = "*" + gurl.Substring(0, 10) + " " + gurl.Substring(10, 11) + " " +
gurl.Substring(21) + "*";
}
}
AddQRTag(gfx, 3, 3, baseQR + gurl, gocr);
}
Regards
Jegan