Совсем недавно столкнулся с такой проблемой: В организации есть сервер удаленных приложений, на нем крутится 1С, пользователи используют ее через
Как же можно увидеть, что ошибка на локальной машине при получении файла *.xps все-таки есть? Очень просто, необходимо перед печатью поставить галочку «печать в файл» и сохранить этот файл с расширение
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
URI запуска: C:\Errors\1.xps Идентификация приложения: System.Windows.Markup.XamlParseException: Не удалось выполнить инициализацию объекта (ISupportInitialize.EndInit). URI запуска: C:\Errors\1.xps Идентификация приложения: System.Windows.Markup.XamlParseException: Не удалось выполнить инициализацию объекта (ISupportInitialize.EndInit). Слишком большие значения advanceWidths и glyphOffsets для GlyphRun. Площадь ограничивающего прямоугольника (измененная в квадратах renderingEmSize) равна "1641,04" и не может превышать значение "1250". Ошибка объекта "System.Windows.Documents.FixedDocument", строка 4, позиция 3. ---> System.OverflowException: Слишком большие значения advanceWidths и glyphOffsets для GlyphRun. Площадь ограничивающего прямоугольника (измененная в квадратах renderingEmSize) равна "1641,04" и не может превышать значение "1250". в System.Windows.Media.GlyphRun.ReportAreaOverflow(Double relativeArea, Double relativeAreaMax) в System.Windows.Media.GlyphRun.Initialize(GlyphTypeface glyphTypeface, Int32 bidiLevel, Boolean isSideways, Double renderingEmSize, IList`1 glyphIndices, Point baselineOrigin, IList`1 advanceWidths, IList`1 glyphOffsets, IList`1 characters, String deviceFontName, IList`1 clusterMap, IList`1 caretStops, XmlLanguage language, Boolean throwOnOverflow) в System.Windows.Media.GlyphRun..ctor(GlyphTypeface glyphTypeface, Int32 bidiLevel, Boolean isSideways, Double renderingEmSize, IList`1 glyphIndices, Point baselineOrigin, IList`1 advanceWidths, IList`1 glyphOffsets, IList`1 characters, String deviceFontName, IList`1 clusterMap, IList`1 caretStops, XmlLanguage language) в System.Windows.Documents.Glyphs.LayoutDependentGlyphRunProperties.CreateGlyphRun(Point origin, XmlLanguage language) в System.Windows.Documents.Glyphs.ComputeMeasurementGlyphRunAndOrigin() в System.Windows.Documents.Glyphs.MeasureOverride(Size constraint) в System.Windows.FrameworkElement.MeasureCore(Size availableSize) в System.Windows.UIElement.Measure(Size availableSize) в System.Windows.Controls.Canvas.MeasureOverride(Size constraint) в System.Windows.FrameworkElement.MeasureCore(Size availableSize) в System.Windows.UIElement.Measure(Size availableSize) в System.Windows.Documents.FixedPage.MeasureOverride(Size constraint) в System.Windows.FrameworkElement.MeasureCore(Size availableSize) в System.Windows.UIElement.Measure(Size availableSize) в System.Windows.Documents.FixedDocument.GetPage(Int32 pageNumber) в System.Windows.Documents.FixedDocument.OnInitialized(Object sender, EventArgs e) в System.Windows.FrameworkContentElement.RaiseInitialized(EventPrivateKey key, EventArgs e) в System.Windows.FrameworkContentElement.OnInitialized(EventArgs e) в System.Windows.FrameworkContentElement.TryFireInitialized() в System.Windows.FrameworkContentElement.EndInit() в System.Windows.Markup.BamlRecordReader.ElementEndInit(Object& element) --- Конец трассировки внутреннего стека исключений --- в System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) в System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) в System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException) в System.Windows.Markup.BamlRecordReader.ElementEndInit(Object& element) в System.Windows.Markup.BamlRecordReader.ReadElementEndRecord(Boolean fromNestedBamlRecordReader) в System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) в System.Windows.Markup.BamlRecordReader.Read(BamlRecord bamlRecord, Int32 lineNumber, Int32 linePosition) в System.Windows.Markup.XamlTreeBuilder.BamlRecordWriterSyncUpdate(BamlRecord bamlRecord, Int32 lineNumber, Int32 linePosition) в System.Windows.Markup.XamlTreeBuilderBamlRecordWriter.WriteBamlRecord(BamlRecord bamlRecord, Int32 lineNumber, Int32 linePosition) в System.Windows.Markup.BamlRecordWriter.WriteAndReleaseRecord(BamlRecord bamlRecord, XamlNode xamlNode) в System.Windows.Markup.BamlRecordWriter.WriteElementEnd(XamlElementEndNode xamlElementEndNode) в System.Windows.Markup.XamlParser.WriteElementEnd(XamlElementEndNode xamlElementEndNode) в System.Windows.Markup.XamlParser.ProcessXamlNode(XamlNode xamlNode, Boolean& cleanup, Boolean& done) в System.Windows.Markup.XamlParser.ReadXaml(Boolean singleRecordMode) в System.Windows.Markup.TreeBuilderXamlTranslator._Parse() в System.Windows.Markup.XamlParser.Parse() в System.Windows.Markup.XamlTreeBuilder.ParseFragment() в System.Windows.Markup.TreeBuilder.Parse() в System.Windows.Markup.XamlReader.XmlTreeBuildDefault(ParserContext pc, XmlReader reader, Boolean wrapWithMarkupCompatReader, XamlParseMode parseMode, Boolean etwTracingEnabled) в System.Windows.Markup.XamlReader.Load(XmlReader reader, ParserContext context, XamlParseMode parseMode) в System.Windows.Documents.XpsValidatingLoader.Load(Stream stream, Uri parentUri, ParserContext pc, ContentType mimeType, String rootElement) в System.Windows.Documents.DocumentReference._LoadDocument() в System.Windows.Documents.DocumentReference.GetDocument(Boolean forceReload) в System.Windows.Documents.FixedDocumentSequence.GetPaginator(DocumentReference docRef) в System.Windows.Documents.FixedDocumentSequence.get_PageCount() в System.Windows.Documents.FixedDocumentSequence._OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args) в System.Windows.Documents.DocumentReferenceCollection.OnCollectionChanged(NotifyCollectionChangedAction action, Object item, Int32 index) в System.Windows.Documents.DocumentReferenceCollection.Add(DocumentReference item) в System.Windows.Documents.FixedDocumentSequence._OnDocumentReferenceInitialized(Object sender, EventArgs e) в System.Windows.FrameworkElement.RaiseInitialized(EventPrivateKey key, EventArgs e) в System.Windows.FrameworkElement.OnInitialized(EventArgs e) в System.Windows.FrameworkElement.TryFireInitialized() в System.Windows.FrameworkElement.EndInit() в System.Windows.Markup.BamlRecordReader.ElementEndInit(Object& element) в System.Windows.Markup.BamlRecordReader.ReadElementEndRecord(Boolean fromNestedBamlRecordReader) в System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) в System.Windows.Markup.BamlRecordReader.Read(BamlRecord bamlRecord, Int32 lineNumber, Int32 linePosition) в System.Windows.Markup.XamlTreeBuilder.BamlRecordWriterSyncUpdate(BamlRecord bamlRecord, Int32 lineNumber, Int32 linePosition) в System.Windows.Markup.XamlTreeBuilderBamlRecordWriter.WriteBamlRecord(BamlRecord bamlRecord, Int32 lineNumber, Int32 linePosition) в System.Windows.Markup.BamlRecordWriter.WriteAndReleaseRecord(BamlRecord bamlRecord, XamlNode xamlNode) в System.Windows.Markup.BamlRecordWriter.WriteElementEnd(XamlElementEndNode xamlElementEndNode) в System.Windows.Markup.XamlParser.WriteElementEnd(XamlElementEndNode xamlElementEndNode) в System.Windows.Markup.XamlParser.ProcessXamlNode(XamlNode xamlNode, Boolean& cleanup, Boolean& done) в System.Windows.Markup.XamlParser.ReadXaml(Boolean singleRecordMode) в System.Windows.Markup.TreeBuilderXamlTranslator._Parse() в System.Windows.Markup.XamlParser.Parse() в System.Windows.Markup.XamlTreeBuilder.ParseFragment() в System.Windows.Markup.TreeBuilder.Parse() в System.Windows.Markup.XamlReader.XmlTreeBuildDefault(ParserContext pc, XmlReader reader, Boolean wrapWithMarkupCompatReader, XamlParseMode parseMode, Boolean etwTracingEnabled) в System.Windows.Markup.XamlReader.Load(XmlReader reader, ParserContext context, XamlParseMode parseMode) в System.Windows.Documents.XpsValidatingLoader.Load(Stream stream, Uri parentUri, ParserContext pc, ContentType mimeType, String rootElement) в MS.Internal.Documents.DocumentApplication.S0ConverterDoc(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter) в MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter) в System.Windows.Navigation.NavigationService.GetObjectFromResponse(WebRequest request, WebResponse response, Uri destinationUri, Object navState) в System.Windows.Navigation.NavigationService.DoNavigate(Uri source, NavigationMode f, Object navState) в System.Windows.Navigation.NavigateQueueItem.Dispatch(Object obj) в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) в System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) в System.Windows.Threading.DispatcherOperation.InvokeImpl() в System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) в System.Threading.ExecutionContext.runTryCode(Object userData) в System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) в System.Windows.Threading.DispatcherOperation.Invoke() в System.Windows.Threading.Dispatcher.ProcessQueue() в System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) в System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) в System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) в System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) в MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) в System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) в System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) в System.Windows.Threading.Dispatcher.Run() в System.Windows.Application.RunDispatcher(Object ignore) в System.Windows.Application.StartDispatcherInBrowser(Object unused) в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) в System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) в System.Windows.Threading.DispatcherOperation.InvokeImpl() в System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) в System.Threading.ExecutionContext.runTryCode(Object userData) в System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) в System.Windows.Threading.DispatcherOperation.Invoke() в System.Windows.Threading.Dispatcher.ProcessQueue() в System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) в System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) в System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) в System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) |
Дело в том, что при печати по технологи EasyPrint сначала формируется документ формата *.xps, после чего через виртуальный порт происходит перенаправление на локальный принтер. И вот тогда либо появляется сообщение об ошибке «windows presentation foundation terminal Server Print W», либо просто это все игнорируется и ничего не происходит.
Для решения этой проблемы необходимо либо удалить эту длинную строчку, либо сократить ее.
P.S. Для нормальной работы RemoteApp необходимо:
- RDP версии 6.1 не ниже
- Microsoft .NET Framework 3.5 (лучше с SP1)
Спасибо за статью.
Только я до сих пор не понял, как исправить эту ошибку окончательно.
Цитата: «Для решения этой проблемы необходимо либо удалить эту длинную строчку, либо сократить ее.»
Можно по-подробнее?
System.Windows.Markup.XamlParseException: Не удалось выполнить инициализацию объекта (ISupportInitialize.EndInit). Слишком большие значения advanceWidths и glyphOffsets для GlyphRun. Площадь ограничивающего прямоугольника (измененная в квадратах renderingEmSize) равна «1641,04» и не может превышать значение «1250». Ошибка объекта «System.Windows.Documents.FixedDocument», строка 4, позиция 3.
Вот, например, в моем примере видно, что длинная строка, из-за которой происходит ошибка, находится: строка 4, позиция 3.
Далее смотрим, что это за строка и либо вручную ее сокращаем до 1250 символов, либо программно в 1С конфигураторе.