|
@@ -25,7 +25,7 @@ namespace Compdfkit_Tools.PDFControlUI
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private int _customPageIndex;
|
|
|
|
|
|
+ private int _customPageIndex = 1;
|
|
public int CustomPageIndex
|
|
public int CustomPageIndex
|
|
{
|
|
{
|
|
get => _customPageIndex;
|
|
get => _customPageIndex;
|
|
@@ -94,7 +94,7 @@ namespace Compdfkit_Tools.PDFControlUI
|
|
|
|
|
|
if (filePath != string.Empty)
|
|
if (filePath != string.Empty)
|
|
{
|
|
{
|
|
- CPDFDocument pdfDoc=CPDFDocument.InitWithFilePath(filePath);
|
|
|
|
|
|
+ CPDFDocument pdfDoc = CPDFDocument.InitWithFilePath(filePath);
|
|
if (pdfDoc.IsLocked)
|
|
if (pdfDoc.IsLocked)
|
|
{
|
|
{
|
|
PasswordWindow passwordWindow = new PasswordWindow();
|
|
PasswordWindow passwordWindow = new PasswordWindow();
|
|
@@ -114,15 +114,15 @@ namespace Compdfkit_Tools.PDFControlUI
|
|
{
|
|
{
|
|
WritableComboBoxControl.MaxPageIndex = pdfDoc.PageCount;
|
|
WritableComboBoxControl.MaxPageIndex = pdfDoc.PageCount;
|
|
FilePathTextBox.Text = filePath;
|
|
FilePathTextBox.Text = filePath;
|
|
- PasswordChanged?.Invoke(sender, string.Empty);
|
|
|
|
|
|
+ PasswordChanged?.Invoke(sender, string.Empty);
|
|
SelectedFileChanged?.Invoke(sender, filePath);
|
|
SelectedFileChanged?.Invoke(sender, filePath);
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
private void PasswordWindow_DialogClosed(object sender, PasswordEventArgs e)
|
|
private void PasswordWindow_DialogClosed(object sender, PasswordEventArgs e)
|
|
{
|
|
{
|
|
- if(e.DialogResult != string.Empty)
|
|
|
|
|
|
+ if (e.DialogResult != string.Empty)
|
|
{
|
|
{
|
|
password = e.DialogResult;
|
|
password = e.DialogResult;
|
|
PasswordChanged?.Invoke(sender, e.DialogResult);
|
|
PasswordChanged?.Invoke(sender, e.DialogResult);
|
|
@@ -148,7 +148,7 @@ namespace Compdfkit_Tools.PDFControlUI
|
|
|
|
|
|
public void CustomPageLocationChange(int index = -2)
|
|
public void CustomPageLocationChange(int index = -2)
|
|
{
|
|
{
|
|
- if (index == -2 && PageTextBox.Text != null)
|
|
|
|
|
|
+ if (index == -2 && !string.IsNullOrEmpty(PageTextBox.Text))
|
|
{
|
|
{
|
|
index = int.Parse(PageTextBox.Text);
|
|
index = int.Parse(PageTextBox.Text);
|
|
}
|
|
}
|