Files
2024-09-28 15:33:23 +08:00

25 lines
520 B
C#

using System;
using PDFPatcher.Common;
namespace PDFPatcher.Processor
{
sealed class ShiftPageProcessor : IInfoDocProcessor
{
public int Offset { get; set; }
#region IInfoDocProcessor 成员
public bool Process(System.Xml.XmlElement item) {
var a = item.GetAttributeNode(Constants.DestinationAttributes.Page);
if (a != null && a.Value.TryParse(out int pageNum)/* && pageNum > 0*/) {
pageNum += Offset;
a.Value = pageNum.ToText();
return true;
}
return false;
}
#endregion
}
}