|
@@ -4,10 +4,7 @@ using ComPDFKit.PDFDocument;
|
|
using ComPDFKit.PDFPage;
|
|
using ComPDFKit.PDFPage;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
-using System.Drawing;
|
|
|
|
-using System.Drawing.Imaging;
|
|
|
|
using System.IO;
|
|
using System.IO;
|
|
-using System.Runtime.InteropServices;
|
|
|
|
using ImageMagick;
|
|
using ImageMagick;
|
|
|
|
|
|
namespace AnnotationTest
|
|
namespace AnnotationTest
|
|
@@ -101,7 +98,7 @@ namespace AnnotationTest
|
|
new CPoint(100,10),
|
|
new CPoint(100,10),
|
|
});
|
|
});
|
|
ink.SetInkPath(points);
|
|
ink.SetInkPath(points);
|
|
- ink.SetInkRect(new CRect(10, 10, 200, 200));
|
|
|
|
|
|
+ ink.SetInkRect(new CRect(10, 200, 200, 10));
|
|
|
|
|
|
ink.UpdateAp();
|
|
ink.UpdateAp();
|
|
}
|
|
}
|
|
@@ -131,7 +128,7 @@ namespace AnnotationTest
|
|
|
|
|
|
// Circle
|
|
// Circle
|
|
CPDFCircleAnnotation circle = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE) as CPDFCircleAnnotation;
|
|
CPDFCircleAnnotation circle = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE) as CPDFCircleAnnotation;
|
|
- circle.SetRect(new CRect(10, 300, 110, 410));
|
|
|
|
|
|
+ circle.SetRect(new CRect(10, 410, 110, 300));
|
|
circle.SetLineColor(lineColor);
|
|
circle.SetLineColor(lineColor);
|
|
circle.SetBgColor(bgColor);
|
|
circle.SetBgColor(bgColor);
|
|
circle.SetTransparency(120);
|
|
circle.SetTransparency(120);
|
|
@@ -161,7 +158,7 @@ namespace AnnotationTest
|
|
textAnnotation.SetColor(new byte[] { 255, 0, 0 });
|
|
textAnnotation.SetColor(new byte[] { 255, 0, 0 });
|
|
textAnnotation.SetTransparency(255);
|
|
textAnnotation.SetTransparency(255);
|
|
textAnnotation.SetContent("ComPDFKit");
|
|
textAnnotation.SetContent("ComPDFKit");
|
|
- textAnnotation.SetRect(new CRect(300, 600, 350, 650));
|
|
|
|
|
|
+ textAnnotation.SetRect(new CRect(300, 650, 350, 600));
|
|
textAnnotation.UpdateAp();
|
|
textAnnotation.UpdateAp();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -173,7 +170,7 @@ namespace AnnotationTest
|
|
{
|
|
{
|
|
CPDFPage page = document.PageAtIndex(1);
|
|
CPDFPage page = document.PageAtIndex(1);
|
|
CPDFSoundAnnotation sound = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_SOUND) as CPDFSoundAnnotation;
|
|
CPDFSoundAnnotation sound = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_SOUND) as CPDFSoundAnnotation;
|
|
- sound.SetRect(new CRect(400, 700, 450, 750));
|
|
|
|
|
|
+ sound.SetRect(new CRect(400, 750, 450, 700));
|
|
sound.SetSoundPath(null,"Bird.wav");
|
|
sound.SetSoundPath(null,"Bird.wav");
|
|
sound.UpdateAp();
|
|
sound.UpdateAp();
|
|
}
|
|
}
|
|
@@ -185,7 +182,7 @@ namespace AnnotationTest
|
|
static private void CreateMarkupAnnotation(CPDFDocument document)
|
|
static private void CreateMarkupAnnotation(CPDFDocument document)
|
|
{
|
|
{
|
|
List<CRect> cRectList = new List<CRect>();
|
|
List<CRect> cRectList = new List<CRect>();
|
|
- CRect rect = new CRect(300, 240, 400, 300);
|
|
|
|
|
|
+ CRect rect = new CRect(300, 300, 400, 240);
|
|
cRectList.Add(rect);
|
|
cRectList.Add(rect);
|
|
byte[] color = { 255, 0, 0 };
|
|
byte[] color = { 255, 0, 0 };
|
|
|
|
|
|
@@ -238,13 +235,13 @@ namespace AnnotationTest
|
|
// Standard
|
|
// Standard
|
|
CPDFStampAnnotation standard = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP) as CPDFStampAnnotation;
|
|
CPDFStampAnnotation standard = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP) as CPDFStampAnnotation;
|
|
standard.SetStandardStamp("Approved");
|
|
standard.SetStandardStamp("Approved");
|
|
- standard.SetRect(new CRect(300, 100, 450, 160));
|
|
|
|
|
|
+ standard.SetRect(new CRect(300, 160, 450, 100));
|
|
standard.UpdateAp();
|
|
standard.UpdateAp();
|
|
|
|
|
|
// Text
|
|
// Text
|
|
CPDFStampAnnotation text = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP) as CPDFStampAnnotation;
|
|
CPDFStampAnnotation text = page.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP) as CPDFStampAnnotation;
|
|
text.SetTextStamp("test", "detail text", C_TEXTSTAMP_SHAPE.TEXTSTAMP_LEFT_TRIANGLE, C_TEXTSTAMP_COLOR.TEXTSTAMP_RED);
|
|
text.SetTextStamp("test", "detail text", C_TEXTSTAMP_SHAPE.TEXTSTAMP_LEFT_TRIANGLE, C_TEXTSTAMP_COLOR.TEXTSTAMP_RED);
|
|
- text.SetRect(new CRect(300, 220, 450, 300));
|
|
|
|
|
|
+ text.SetRect(new CRect(300, 300, 450, 220));
|
|
|
|
|
|
text.UpdateAp();
|
|
text.UpdateAp();
|
|
|
|
|
|
@@ -257,7 +254,7 @@ namespace AnnotationTest
|
|
stampAnnotation.SetImageStamp(byteArray, image.Width, image.Height);
|
|
stampAnnotation.SetImageStamp(byteArray, image.Width, image.Height);
|
|
}
|
|
}
|
|
|
|
|
|
- stampAnnotation.SetRect(new CRect(300, 320, 380, 400));
|
|
|
|
|
|
+ stampAnnotation.SetRect(new CRect(300, 400, 380, 320));
|
|
stampAnnotation.SetTransparency(255);
|
|
stampAnnotation.SetTransparency(255);
|
|
stampAnnotation.UpdateAp();
|
|
stampAnnotation.UpdateAp();
|
|
}
|
|
}
|