프로젝트

일반

사용자정보

개정판 59e0aa5f

ID59e0aa5f8e1f63315219771a0290a02652ec7c79
상위 93fe2e14
하위 d251456f, 7f01e35f

백흠경이(가) 5년 이상 전에 추가함

issue 968: adjust line width

Change-Id: I1c1897d39b19de5734bd4d2a3c06c7bc21d2bcfc

차이점 보기:

FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_DrawString.cs
61 61
                mat2.RotateAt((float)Angle * -1, new System.Drawing.PointF((float)sp.X, (float)sp.Y));
62 62
                contentByte.Transform(mat2);
63 63

  
64
                contentByte.ClosePathFillStroke();
64
                contentByte.Fill();
65 65
                contentByte.RestoreState();
66 66
                contentByte.SaveState();
67 67
            }
......
172 172
            contentByte.SaveState();
173 173

  
174 174
            Rect rect = new Rect(sp, ep);
175
            List<Point> point = new List<Point>();
176
            point.Add(rect.TopLeft);
177
            point.Add(rect.BottomLeft);
178
            point.Add(rect.BottomRight);
179
            point.Add(rect.TopRight);
175
            List<Point> points = new List<Point>();
176
            points.Add(rect.TopLeft);
177
            points.Add(rect.BottomLeft);
178
            points.Add(rect.BottomRight);
179
            points.Add(rect.TopRight);
180 180

  
181 181
            //lineSize = 1;
182
            var calRect = MathSet.GetPointsToRectX(point);
182
            var calRect = MathSet.GetPointsToRectX(points);
183 183
            lineSize = lineSize * 72 / 96*0.5;
184 184
            contentByte.SetLineWidth((float)lineSize);
185 185

  
186
            //PaintStyle = MarkupEditToolKit.Common.PaintSet.Fill;
187

  
188 186
            if ((PaintStyle & PaintSet.Hatch) == PaintSet.Hatch)
189 187
            {
190 188
                double ArcLength = 10;  /// default arc length
191 189

  
192
                DrawSet_Cloud.DrawCloud(point, lineSize, ArcLength, contentByte, new DoubleCollection(99999), color, (PaintStyle & ~PaintSet.Hatch), opac);
190
                DrawSet_Cloud.DrawCloud(points, lineSize, ArcLength, contentByte, new DoubleCollection(99999), color, (PaintStyle & ~PaintSet.Hatch), opac);
193 191

  
194
                ///contentByte.ClosePath();    ///TODO: check this is need
195 192
                contentByte.RestoreState();
196 193
                contentByte.SaveState();
197 194
            }
198
            else if (((PaintStyle & PaintSet.Highlight) == PaintSet.Highlight) || ((PaintStyle & PaintSet.Fill) == PaintSet.Fill))
195
            else
199 196
            {
200
                PdfGState gs1 = new PdfGState();
201
                gs1.FillOpacity = 0.7f;
202
                gs1.StrokeOpacity = (float)opac;
203
                if ((PaintStyle & PaintSet.Highlight) == PaintSet.Highlight)
204
                {
205
                    contentByte.SetColorFill(BaseColor.YELLOW);
206
                }
207
                else
208
                {
209
                    contentByte.SetColorFill(BaseColor.WHITE);
210
                }
211
                contentByte.SetColorStroke(bs);
212
                contentByte.SetGState(gs1);
213

  
214 197
                contentByte.NewPath();
215
                contentByte.Rectangle((float)calRect.Left, (float)calRect.Bottom, (float)calRect.Width, (float)calRect.Height);
216
                System.Drawing.Drawing2D.Matrix mat2 = new System.Drawing.Drawing2D.Matrix();
217
                mat2.RotateAt((float)Angle * -1, new System.Drawing.PointF((float)sp.X, (float)sp.Y));
218
                contentByte.Transform(mat2);
219

  
220
                contentByte.ClosePathFillStroke();
221
                contentByte.RestoreState();
222
                contentByte.SaveState();
198
                contentByte.MoveTo(points[0].X, points[0].Y);
199
                for (int i = 1; i <= points.Count; ++i) contentByte.LineTo(points[i%points.Count].X, points[i%points.Count].Y);
200
                HoneyPDFLib_DrawSet_Shape.PaintFill(contentByte, PaintStyle, bs);
223 201
            }
224

  
202
            
225 203
            string ARIALUNI_TFF = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "Arial Unicode MS.TTF");
226 204
            BaseFont bf = BaseFont.CreateFont(ARIALUNI_TFF, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
227 205

  
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_Line.cs
31 31

  
32 32
            /// WPF defines a device-independent pixel as 1 / 96 per inch
33 33
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
34
            lineSize = lineSize * 72 / 96;
35

  
36
            /*if (lineSize < 3)
37
            {
38
                lineSize = 2.5;
39
            }
40

  
41
            contentByte.SetLineWidth((float)lineSize - 2);
42
            */
34
            lineSize = lineSize * 72 / 96 * 0.5;
43 35
            contentByte.SetLineWidth((float)lineSize);
44 36
            contentByte.MoveTo((float)startP.X, (float)startP.Y);
45 37
            contentByte.LineTo((float)endP.X, (float)endP.Y);
......
175 167

  
176 168
            /// WPF defines a device-independent pixel as 1 / 96 per inch
177 169
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
178
            lineSize = lineSize*72/96;
179

  
180
            /*if (lineSize < 3)
181
            {
182
                lineSize = 2.5;
183
            }
184

  
185
            contentByte.SetLineWidth((float)lineSize - 2);
186
            */
170
            lineSize = lineSize*72/96*0.5;
187 171
            contentByte.SetLineWidth((float)lineSize);
188 172
            for (int i = 0; i < list.Count; i++)
189 173
            {
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_Shape.cs
143 143
            /// WPF defines a device-independent pixel as 1 / 96 per inch
144 144
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
145 145
            lineSize = lineSize * 72 / 96;
146

  
147
            /*if (lineSize < 3)
148
            {
149
                lineSize = 2.5;
150
            }
151

  
152
            contentByte.SetLineWidth((float)lineSize - 2);
153
            */
154 146
            contentByte.SetLineWidth((float)lineSize);
155 147

  
156 148
            contentByte.NewPath();
......
171 163
            PaintFill(contentByte, PaintStyle, bs);
172 164
            contentByte.RestoreState();
173 165
        }
166

  
174 167
        public static void PaintFill(PdfContentByte contentByte, PaintSet PaintStyle, BaseColor bs)
175 168
        {
176 169
            if ((PaintStyle & PaintSet.Highlight) == PaintSet.Highlight)
......
179 172
                gs.FillOpacity = (float)0.7;
180 173
                contentByte.SetGState(gs);
181 174
                contentByte.SetColorFill(BaseColor.YELLOW);
182
                contentByte.Fill();
175
                if ((PaintStyle & PaintSet.Fill) == PaintSet.Fill)
176
                {
177
                    contentByte.SetColorStroke(bs);
178
                    contentByte.ClosePathFillStroke();
179
                }
180
                else
181
                    contentByte.Fill();
182

  
183
                return;
183 184
            }
184 185

  
185 186
            if ((PaintStyle & PaintSet.Fill) == PaintSet.Fill)
......
205 206

  
206 207
            if(PaintStyle == PaintSet.None)
207 208
            {
208
                //PdfGState gs1 = new PdfGState();
209
                //gs1.FillOpacity = 0.8f;
210
                //contentByte.SetColorFill(BaseColor.WHITE);
211
                //contentByte.SetGState(gs1);
212
                //contentByte.ClosePathFillStroke();
213 209
                contentByte.ClosePathStroke();
214 210
            }
215 211
        }

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)