Esempio n. 1
0
        public void ConvertToJPEG(string _ruta, string _source, int width, int height)
        {
            Bitmap bitmap = null;

            Apitron.PDF.Rasterizer.Document document = null;
            try
            {
                using (FileStream fs = new FileStream(_ruta, FileMode.Open))
                {
                    document = new Apitron.PDF.Rasterizer.Document(fs);

                    Apitron.PDF.Rasterizer.Configuration.RenderingSettings settings = new Apitron.PDF.Rasterizer.Configuration.RenderingSettings();

                    Apitron.PDF.Rasterizer.Page currentPage = document.Pages[0];

                    using (bitmap = currentPage.Render(width, height, settings))
                    {
                        bitmap.Save(string.Format(@"C:\temp\SGUV-IMG\{0}.png", 0), ImageFormat.Png);
                    }
                }
            }
            catch (Exception)
            {
            }
            finally
            {
                document.Dispose();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AnnotationViewModel"/> class.
        /// </summary>
        /// <param name="annotation">The annotation.</param>
        public AnnotationViewModel(Annotation annotation, Page page)
        {
            this.annotation = annotation;
            baseHeight      = page.Height;

            this.rect = new Rect(annotation.Boundary.Left, baseHeight - annotation.Boundary.Top,
                                 annotation.Boundary.Width, annotation.Boundary.Height);

            mouseDown = new ApitronCommand((o) => true, MouseDownHandler);
            mouseUp   = new ApitronCommand((o) => true, MouseUpHandler);
            mouseMove = new ApitronCommand((o) => true, MouseMoveHandler);
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnnotationViewModel"/> class.
 /// </summary>
 /// <param name="annotation">The annotation.</param>
 public TextAnnotationViewModel(Annotation annotation, Page page) : base(annotation, page)
 {
 }