|
@@ -66,7 +66,7 @@ namespace ComPDFKit.Tool.UndoManger
|
|
if (stampAnnot != null)
|
|
if (stampAnnot != null)
|
|
{
|
|
{
|
|
int annotIndex = pdfPage.GetAnnotCount() - 1;
|
|
int annotIndex = pdfPage.GetAnnotCount() - 1;
|
|
- switch(currentParam.StampType)
|
|
|
|
|
|
+ switch (currentParam.StampType)
|
|
{
|
|
{
|
|
case C_STAMP_TYPE.STANDARD_STAMP:
|
|
case C_STAMP_TYPE.STANDARD_STAMP:
|
|
{
|
|
{
|
|
@@ -79,6 +79,7 @@ namespace ComPDFKit.Tool.UndoManger
|
|
stampAnnot.SetStandardStamp(stampText, pdfPage.Rotation);
|
|
stampAnnot.SetStandardStamp(stampText, pdfPage.Rotation);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case C_STAMP_TYPE.TEXT_STAMP:
|
|
case C_STAMP_TYPE.TEXT_STAMP:
|
|
{
|
|
{
|
|
string dateText = currentParam.DateText;
|
|
string dateText = currentParam.DateText;
|
|
@@ -101,6 +102,7 @@ namespace ComPDFKit.Tool.UndoManger
|
|
pdfPage.Rotation);
|
|
pdfPage.Rotation);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case C_STAMP_TYPE.IMAGE_STAMP:
|
|
case C_STAMP_TYPE.IMAGE_STAMP:
|
|
{
|
|
{
|
|
byte[] imageData = null;
|
|
byte[] imageData = null;
|
|
@@ -109,6 +111,8 @@ namespace ComPDFKit.Tool.UndoManger
|
|
PDFHelp.ImageStreamToByte(currentParam.ImageStream, ref imageData, ref imageWidth, ref imageHeight);
|
|
PDFHelp.ImageStreamToByte(currentParam.ImageStream, ref imageData, ref imageWidth, ref imageHeight);
|
|
if (imageData != null && imageWidth > 0 && imageHeight > 0)
|
|
if (imageData != null && imageWidth > 0 && imageHeight > 0)
|
|
{
|
|
{
|
|
|
|
+ stampAnnot.SetSourceRect(currentParam.SourceRect);
|
|
|
|
+ stampAnnot.AnnotationRotator.SetRotation(currentParam.Rotation);
|
|
stampAnnot.SetImageStamp(
|
|
stampAnnot.SetImageStamp(
|
|
imageData,
|
|
imageData,
|
|
imageWidth,
|
|
imageWidth,
|
|
@@ -122,8 +126,12 @@ namespace ComPDFKit.Tool.UndoManger
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- stampAnnot.SetSourceRect(currentParam.SourceRect);
|
|
|
|
- stampAnnot.AnnotationRotator.SetRotation(currentParam.Rotation);
|
|
|
|
|
|
+ if(currentParam.StampType != C_STAMP_TYPE.IMAGE_STAMP)
|
|
|
|
+ {
|
|
|
|
+ stampAnnot.SetSourceRect(currentParam.SourceRect);
|
|
|
|
+ stampAnnot.AnnotationRotator.SetRotation(currentParam.Rotation);
|
|
|
|
+ }
|
|
|
|
+
|
|
stampAnnot.SetTransparency(currentParam.Transparency);
|
|
stampAnnot.SetTransparency(currentParam.Transparency);
|
|
string imagePath = string.Empty;
|
|
string imagePath = string.Empty;
|
|
if (currentParam.Transparency <255 && GetAnnotOpacityImage(stampAnnot, currentParam.Transparency / 255.0, 5, out imagePath) && File.Exists(imagePath))
|
|
if (currentParam.Transparency <255 && GetAnnotOpacityImage(stampAnnot, currentParam.Transparency / 255.0, 5, out imagePath) && File.Exists(imagePath))
|