|
@@ -950,6 +950,7 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
string pageparm = CommonHelper.GetPageParmFromList(selectedPageList);
|
|
string pageparm = CommonHelper.GetPageParmFromList(selectedPageList);
|
|
TbPageRange = pageparm;
|
|
TbPageRange = pageparm;
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
//Ctrl+A时让所有item选中
|
|
//Ctrl+A时让所有item选中
|
|
@@ -1876,10 +1877,7 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
PageEditItem item = new PageEditItem();
|
|
PageEditItem item = new PageEditItem();
|
|
- if (width > height)
|
|
|
|
- {
|
|
|
|
- item.isVertical = false;
|
|
|
|
- }
|
|
|
|
|
|
+ item.Size = PDFViewer.Document.GetPageSize(insertIndex);
|
|
PageEditItems.Insert(insertIndex, item);
|
|
PageEditItems.Insert(insertIndex, item);
|
|
ReloadAfterOption(true, true, Tuple.Create(insertIndex - 1, insertIndex + 1));
|
|
ReloadAfterOption(true, true, Tuple.Create(insertIndex - 1, insertIndex + 1));
|
|
return true;
|
|
return true;
|
|
@@ -1904,9 +1902,9 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
item.PageNumber = index + 1;
|
|
item.PageNumber = index + 1;
|
|
var pagesize = PDFViewer.Document.GetPageSize(index);
|
|
var pagesize = PDFViewer.Document.GetPageSize(index);
|
|
item.Size = pagesize;
|
|
item.Size = pagesize;
|
|
- double width = CommonHelper.GetUnitsFromPageSize(pagesize.Width);
|
|
|
|
- double height = CommonHelper.GetUnitsFromPageSize(pagesize.Height);
|
|
|
|
- item.PageSize = $"{width.ToString("F0")}mm*{height.ToString("F0")} mm";
|
|
|
|
|
|
+ //double width = CommonHelper.GetUnitsFromPageSize(pagesize.Width);
|
|
|
|
+ //double height = CommonHelper.GetUnitsFromPageSize(pagesize.Height);
|
|
|
|
+ //item.PageSize = $"{width.ToString("F0")}mm*{height.ToString("F0")} mm";
|
|
return item;
|
|
return item;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1973,8 +1971,8 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
PDFViewer.Document.ReleasePages(i);
|
|
PDFViewer.Document.ReleasePages(i);
|
|
items.Add(i, i);
|
|
items.Add(i, i);
|
|
|
|
|
|
|
|
+ PageEditItems[i].Size = PDFViewer.Document.GetPageSize(i);
|
|
//重新拿图
|
|
//重新拿图
|
|
- PageEditItems[i].isVertical = !PageEditItems[i].isVertical;
|
|
|
|
PageEditItems[i].IsGetImage = false;
|
|
PageEditItems[i].IsGetImage = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1989,8 +1987,8 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
items.Add(pageitems[i], pageitems[i]);
|
|
items.Add(pageitems[i], pageitems[i]);
|
|
|
|
|
|
//重新拿图
|
|
//重新拿图
|
|
- PageEditItems[pageitems[i]].isVertical = !PageEditItems[pageitems[i]].isVertical;
|
|
|
|
PageEditItems[pageitems[i]].IsGetImage = false;
|
|
PageEditItems[pageitems[i]].IsGetImage = false;
|
|
|
|
+ PageEditItems[i].Size = PDFViewer.Document.GetPageSize(i);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2076,9 +2074,10 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 3://横向页面
|
|
case 3://横向页面
|
|
|
|
+ ListSelectedIndex = -1;
|
|
for (int i = 0; i < PageEditItems.Count; i++)
|
|
for (int i = 0; i < PageEditItems.Count; i++)
|
|
{
|
|
{
|
|
- if (PDFViewer.Document.PageAtIndex(i).Rotation % 2 != 0)
|
|
|
|
|
|
+ if (!PageEditItems[i].isVertical)
|
|
{
|
|
{
|
|
pageRange.Add(i + 1);
|
|
pageRange.Add(i + 1);
|
|
}
|
|
}
|
|
@@ -2087,7 +2086,7 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
case 4://纵向页面
|
|
case 4://纵向页面
|
|
for (int i = 0; i < PageEditItems.Count; i++)
|
|
for (int i = 0; i < PageEditItems.Count; i++)
|
|
{
|
|
{
|
|
- if (PDFViewer.Document.PageAtIndex(i).Rotation % 2 == 0)
|
|
|
|
|
|
+ if (PageEditItems[i].isVertical)
|
|
{
|
|
{
|
|
pageRange.Add(i + 1);
|
|
pageRange.Add(i + 1);
|
|
}
|
|
}
|
|
@@ -2208,12 +2207,27 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
//宽高为样式中图片控件宽高
|
|
//宽高为样式中图片控件宽高
|
|
if (PageEditItems[i].isVertical)
|
|
if (PageEditItems[i].isVertical)
|
|
{
|
|
{
|
|
- await PDFViewer.GetThumbnail(i, 208, 294);
|
|
|
|
|
|
+ //等比例缩放
|
|
|
|
+ if (PageEditItems[i].Size.Height > 300)
|
|
|
|
+ {
|
|
|
|
+ await PDFViewer.GetThumbnail(i, (int)(PageEditItems[i].Size.Width / (PageEditItems[i].Size.Height / 300)), 300);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ await PDFViewer.GetThumbnail(i, (int)PageEditItems[i].Size.Width, (int)PageEditItems[i].Size.Height);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //获取横图
|
|
|
|
- await PDFViewer.GetThumbnail(i, 294, 208);
|
|
|
|
|
|
+ if (PageEditItems[i].Size.Width > 300)
|
|
|
|
+ {
|
|
|
|
+ await PDFViewer.GetThumbnail(i, 300, (int)(PageEditItems[i].Size.Height / (PageEditItems[i].Size.Width / 300)));
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ //获取横图
|
|
|
|
+ await PDFViewer.GetThumbnail(i, (int)PageEditItems[i].Size.Width, (int)PageEditItems[i].Size.Height);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2306,7 +2320,7 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//通知UI选中Items
|
|
//通知UI选中Items
|
|
- NotifyUIToRefresh(selectedPages);
|
|
|
|
|
|
+ //NotifyUIToRefresh(selectedPages);
|
|
//刷新页码和图片
|
|
//刷新页码和图片
|
|
ReloadAfterOption(true,true,new Tuple<int, int>(0,PDFViewer.Document.PageCount));
|
|
ReloadAfterOption(true,true,new Tuple<int, int>(0,PDFViewer.Document.PageCount));
|
|
|
|
|
|
@@ -2417,6 +2431,10 @@ namespace PDF_Office.ViewModels.PageEdit
|
|
{
|
|
{
|
|
IsBOTAThumb = Visibility.Visible;
|
|
IsBOTAThumb = Visibility.Visible;
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ IsBOTAThumb = Visibility.Collapsed;
|
|
|
|
+ }
|
|
|
|
|
|
GetSourceItems(isFirstLoad);
|
|
GetSourceItems(isFirstLoad);
|
|
|
|
|