mirror of
https://github.com/wmjordan/PDFPatcher.git
synced 2026-10-19 06:21:06 +08:00
27 lines
573 B
C#
27 lines
573 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
|
|
}
|
|
}
|