mirror of
https://github.com/wmjordan/PDFPatcher.git
synced 2026-10-18 13:42:28 +08:00
-修复页码标签显示不正确的问题
This commit is contained in:
+11
-7
@@ -233,13 +233,17 @@ namespace PDFPatcher
|
||||
internal const string PageLabels = "页码样式";
|
||||
internal static class PageLabelStyles
|
||||
{
|
||||
internal static readonly string[] Names = { "数字", "大写罗马数字", "小写罗马数字", "大写英文字母", "小写英文字母" };
|
||||
internal static readonly char[] PdfValues = { 'D', 'R', 'r', 'A', 'a' };
|
||||
internal static readonly char[] SimpleInfoIdentifiers = { '0', 'I', 'i', 'A', 'a' };
|
||||
internal static readonly int[] Values = { PdfPageLabels.DECIMAL_ARABIC_NUMERALS,
|
||||
PdfPageLabels.UPPERCASE_ROMAN_NUMERALS, PdfPageLabels.LOWERCASE_ROMAN_NUMERALS,
|
||||
PdfPageLabels.UPPERCASE_LETTERS, PdfPageLabels.LOWERCASE_LETTERS
|
||||
};
|
||||
internal static readonly string[] Names = { "数字", "大写罗马数字", "小写罗马数字", "大写英文字母", "小写英文字母", "无" };
|
||||
internal static readonly char[] PdfValues = { 'D', 'R', 'r', 'A', 'a', '-' };
|
||||
internal static readonly char[] SimpleInfoIdentifiers = { '0', 'I', 'i', 'A', 'a', '-' };
|
||||
internal static readonly int[] Values = {
|
||||
PdfPageLabels.DECIMAL_ARABIC_NUMERALS,
|
||||
PdfPageLabels.UPPERCASE_ROMAN_NUMERALS,
|
||||
PdfPageLabels.LOWERCASE_ROMAN_NUMERALS,
|
||||
PdfPageLabels.UPPERCASE_LETTERS,
|
||||
PdfPageLabels.LOWERCASE_LETTERS,
|
||||
PdfPageLabels.EMPTY,
|
||||
};
|
||||
}
|
||||
internal static class PageLabelsAttributes
|
||||
{
|
||||
|
||||
@@ -15,9 +15,6 @@ namespace PDFPatcher.Functions
|
||||
|
||||
public InsertPageLabelForm() {
|
||||
InitializeComponent();
|
||||
this.OnFirstLoad(OnLoad);
|
||||
}
|
||||
void OnLoad() {
|
||||
_NumericStyleBox.AddRange(Constants.PageLabelStyles.Names).Select(0);
|
||||
_RemoveLabelButton.Enabled = false;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace MuPdfSharp
|
||||
var sp = d["St"].IntegerValue;
|
||||
var p = d["P"].StringValue;
|
||||
var s = d["S"].NameValue;
|
||||
pl.Add(new PageLabel(n, sp, p, s.Length == 0 ? PageLabelStyle.Digit : (PageLabelStyle)(byte)s[0]));
|
||||
pl.Add(new PageLabel(n, sp, p, s.Length == 0 ? PageLabelStyle.Default : (PageLabelStyle)(byte)s[0]));
|
||||
}
|
||||
pl.Sort();
|
||||
}
|
||||
|
||||
@@ -87,16 +87,17 @@ namespace MuPdfSharp
|
||||
var n = pageNumber - FromPageNumber + (StartAt < 1 ? 0 : StartAt - 1);
|
||||
switch (NumericStyle) {
|
||||
case PageLabelStyle.Default:
|
||||
return Prefix;
|
||||
case PageLabelStyle.Digit:
|
||||
return String.Concat(Prefix, n.ToText());
|
||||
case PageLabelStyle.UpperRoman:
|
||||
return String.Concat(Prefix, ValueHelper.ToRoman(n));
|
||||
return String.Concat(Prefix, n.ToRoman());
|
||||
case PageLabelStyle.LowerRoman:
|
||||
return String.Concat(Prefix, ValueHelper.ToRoman(n)).ToLowerInvariant();
|
||||
return String.Concat(Prefix, n.ToRoman()).ToLowerInvariant();
|
||||
case PageLabelStyle.UpperAlphabetic:
|
||||
return String.Concat(Prefix, ValueHelper.ToAlphabet(n, true));
|
||||
return String.Concat(Prefix, n.ToAlphabet(true));
|
||||
case PageLabelStyle.LowerAlphabetic:
|
||||
return String.Concat(Prefix, ValueHelper.ToAlphabet(n, false));
|
||||
return String.Concat(Prefix, n.ToAlphabet(false));
|
||||
default:
|
||||
goto case PageLabelStyle.Digit;
|
||||
}
|
||||
@@ -105,7 +106,7 @@ namespace MuPdfSharp
|
||||
|
||||
public enum PageLabelStyle : byte
|
||||
{
|
||||
Default = 0,
|
||||
Default = (byte)'-',
|
||||
Digit = (byte)'d',
|
||||
UpperRoman = (byte)'R',
|
||||
LowerRoman = (byte)'r',
|
||||
|
||||
Reference in New Issue
Block a user