public LayerCollection ToAnnotationUI(LayerData[] layers, string docPath)
            {
                Size[] pageSizes = new Size[0];

                if (File.Exists(docPath))
                {
                    using (FileStream fs = new FileStream(docPath, FileMode.Open, FileAccess.Read, FileShare.Read))
                    {
                        pageSizes = new PageSizeAggregate(new DocumentPageSizes(RegisteredDecoders.GetDecoder(fs), fs, false)).ToArray();
                    }
                }

                return ToAnnotationUI(layers, pageSizes);
            }
예제 #2
0
        public LayerData[] ToWebDocumentViewer(LayerCollection layerCollection, string docPath)
        {
            var pageSizes = new Size[0];

            if (File.Exists(docPath))
            {
                using (var fs = new FileStream(docPath, FileMode.Open, FileAccess.Read, FileShare.Read))
                {
                    pageSizes = new PageSizeAggregate(new DocumentPageSizes(RegisteredDecoders.GetDecoder(fs), fs, false)).ToArray();
                }
            }

            return(ToWebDocumentViewer(layerCollection, pageSizes));
        }