Files
PDFPatcher/App/Processor/InfoDocProcessor/ShiftPageProcessor.cs
T
2021-12-24 20:35:03 +08:00

27 lines
576 B
C#

using System;
using System.Collections.Generic;
using System.Text;
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
}
}