當前位置:首頁 » 文件管理 » 列印字體怎樣變換方向
擴展閱讀
電腦au文件夾可以刪除嗎 2025-05-20 21:07:53
什麼app可以刷臉查戶籍 2025-05-20 21:02:39

列印字體怎樣變換方向

發布時間: 2022-04-01 09:15:20

A. 電腦列印的文字怎麼旋轉

方法一:.在「文件」的選項下,選擇「列印」,在彈出的窗口中選擇「屬性」,然後就可以在「屬性」的「基本」按鈕下選擇文件的列印效果選擇「橫向」,就可以達到旋轉90°的效果 。
方法二:在「文件」的選項下,選擇「頁面設置」,在彈出窗口的「頁邊距」下選擇「方向」,進行更改,選擇「橫向」,也可以達到旋轉90°的效果

B. 如何:更改字處理文檔的列印方向

本文包含一個演示此任務的示例 SetPrintOrientation 方法。必須安裝 才能使用本主題中的示例代碼。必須在項目中明確引用以下程序集:WindowsBaseDocumentFormat.OpenXml(由 Open XML SDK 安裝)還必須使用以下 using 指令或 Imports 語句編譯本主題中的代碼。 C# using�0�2System.Linq; using�0�2DocumentFormat.OpenXml; using�0�2DocumentFormat.OpenXml.Packaging; using�0�2DocumentFormat.OpenXml.Wordprocessing; Visual Basic Imports�0�2DocumentFormat.OpenXml Imports�0�2DocumentFormat.OpenXml.Packaging Imports�0�2DocumentFormat.OpenXml. 方法可以使用 SetPrintOrientation 方法更改字處理文檔的列印方向。該方法接受兩個參數,分別指示要修改的文檔的名稱(字元串)和新列印方向 (PageOrientationValues)。以下代碼顯示 SetPrintOrientation 方法。 C# publicstaticvoid SetPrintOrientation( string fileName, PageOrientationValues newOrientation) Visual Basic PublicSub SetPrintOrientation( ByVal fileName AsString, ByVal newOrientation As PageOrientationValues)對於文檔中的每個部分,如果新的方向與該部分當前的列印方向不同,則該代碼將修改該部分的列印方向。此外,該代碼必須手動更新每個部分的寬度、高度和邊距。調用示例 SetPrintOrientation 方法若要調用示例 SetPrintOrientation 方法,請傳遞包含要轉換的文件的名稱的字元串。以下代碼顯示示例方法調用。 C# SetPrintOrientation(@"C:\Users\Public\Documents\ChangePrintOrientation.docx", PageOrientationValues.Landscape); Visual Basic SetPrintOrientation("C:\Users\Public\Documents\ChangePrintOrientation.docx", PageOrientationValues.Landscape)代碼的工作方式以下代碼先使用 Open 方法打開文檔,並將 isEditable 參數設置為 true,以指示應讀/寫該文檔。該代碼將保留一個布爾變數來跟蹤文檔是否已更改(以便在稍後出現此情況時能夠保存文檔)。該代碼將檢索對主文檔部分的引用,然後使用該引用檢索文檔內容中類型為 SectionProperties 的所有後代的集合。稍後,代碼將使用此集合輪流為每個部分設置方向。 C# using (var document = WordprocessingDocument.Open(fileName, true)) { bool documentChanged = false; var docPart = document.MainDocumentPart; var sections = docPart.Document.Descendants(); // Code removed here... } Visual Basic Using document = WordprocessingDocument.Open(fileName, True) Dim documentChanged AsBoolean = FalseDim docPart = document.MainDocumentPart Dim sections = docPart.Document.Descendants(Of SectionProperties)() ' Code removed here... End Using循環訪問所有部分下一個代碼塊將循環訪問 SectionProperties 元素集合的所有部分。對於每個部分,該代碼都將初始化一個用於跟蹤該部分的頁面方向是否已更改的變數,以便代碼能夠更新頁面大小和邊距。(如果新方向與原始方向匹配,則該代碼不更新頁面。)該代碼將繼續檢索對 PageSize 元素的第一個 SectionProperties 後代的引用。如果此引用不為空,則該代碼將根據需要更新方向。 C# foreach (SectionProperties sectPr in sections) { bool pageOrientationChanged = false; PageSize pgSz = sectPr.Descendants().FirstOrDefault(); if (pgSz != null) { // Code removed here... } } Visual Basic ForEach sectPr As SectionProperties In sections Dim pageOrientationChanged AsBoolean = FalseDim pgSz As PageSize = sectPr.Descendants(Of PageSize).FirstOrDefault If pgSz IsNot NothingThen ' Code removed here... EndIfNext設置部分的方向下一代碼塊先檢查 PageSize 元素的 Orient 屬性是否存在。與 Open XML 元素的許多屬性 (Property) 一樣,該屬性 (Property) 或屬性 (Attribute) 可能並不存在。在這種情況下,檢索該屬性的操作將返回空引用。默認情況下,如果該屬性不存在,並且新方向為縱向,則該代碼將不會更新該頁面。如果 Orient 屬性已存在,並且其值與作為參數提供給方法的新方向值不同,則該代碼將設置 Orient 屬性的 Value 屬性,並設置 pageOrientationChanged 和documentChanged 標志。(該代碼使用 pageOrientationChanged 標志確定它是否必須更新頁面大小和邊距。它使用 documentChanged 標志確定是否必須在最後保存文檔。) 注釋如果該代碼必須創建 Orient 屬性,則它還必須創建要在該屬性中作為新的 EnumValue) 實例存儲的值,並在 EnumValue 構造函數中提供新方向。 C# if (pgSz.Orient == null) { if (newOrientation != PageOrientationValues.Portrait) { pageOrientationChanged = true; documentChanged = true; pgSz.Orient = new EnumValue(newOrientation); } } else { if (pgSz.Orient.Value != newOrientation) { pgSz.Orient.Value = newOrientation; pageOrientationChanged = true; documentChanged = true; } } Visual Basic If pgSz.Orient IsNothingThenIf newOrientation PageOrientationValues.Portrait Then pageOrientationChanged = True documentChanged = True pgSz.Orient = New EnumValue(Of PageOrientationValues)(newOrientation) EndIfElseIf pgSz.Orient.Value newOrientation Then pgSz.Orient.Value = newOrientation pageOrientationChanged = True documentChanged = TrueEndIfEndIf更新頁面大小此時,在代碼中,頁面方向可能已更改。如果出現此情況,則代碼必須再完成兩個任務:它必須更新頁面大小,並且必須更新該部分的頁邊距。第一個任務非常簡單 - 以下代碼將交換頁面高度和寬度,並將值存儲到 PageSize 元素中。 C# if (pageOrientationChanged) { // Changing the orientation is not enough. You must also // change the page size. var width = pgSz.Width; var height = pgSz.Height; pgSz.Width = height; pgSz.Height = width; // Code removed here... } Visual Basic If pageOrientationChanged Then ' Changing the orientation isnot enough. You must also ' change the page size. Dim width = pgSz.Width Dim height = pgSz.Height pgSz.Width = height pgSz.Height = width ' Code removed here... EndIf更新邊距本示例過程中的下一個步驟是處理該部分的邊距。如果頁面方向已更改,則該代碼必須旋轉邊距以進行匹配。為此,該代碼將檢索對該部分的 PageMargin 元素的引用。如果該元素存在,該代碼將旋轉這些邊距。請注意,該代碼會將邊距旋轉 90 度 - 而一些列印機會將邊距旋轉 270 度,並且您可以修改代碼來說明這一點。另請注意,PageMargin 對象的 Top 和Bottom 屬性為有符號值,而 Left 和Right 屬性為無符號值。當該代碼旋轉邊距設置時,它必須在這兩類值之間轉換,如下面的代碼所示。 Create it now. Otherwise, just // set its value. Assume that the default orientation // is Portrait.if (pgSz.Orient == null) { // Need to create the attribute. You do not need to // create the Orient property if the property does not // already exist, and you are setting it to Portrait. // That is the default value.if (newOrientation != PageOrientationValues.Portrait) { pageOrientationChanged = true; documentChanged = true; pgSz.Orient = new EnumValue(newOrientation); } } else { // The Orient property exists, but its value// is different than the new value.if (pgSz.Orient.Value != newOrientation) { pgSz.Orient.Value = newOrientation; pageOrientationChanged = true; documentChanged = true; } } if (pageOrientationChanged) { // Changing the orientation is not enough. You must also // change the page size. var width = pgSz.Width; var height = pgSz.Height; pgSz.Width = height; pgSz.Height = width; PageMargin pgMar = sectPr.Descendants().FirstOrDefault(); if (pgMar != null) { // Rotate margins. Printer settings control how far you // rotate when switching to landscape mode. Not having those// settings, this code rotates 90 degrees. You could easily// modify this behavior, or make it a parameter for the // procere. var top = pgMar.Top.Value; var bottom = pgMar.Bottom.Value; var left = pgMar.Left.Value; var right = pgMar.Right.Value; pgMar.Top = new Int32Value((int)left); pgMar.Bottom = new Int32Value((int)right); pgMar.Left = new UInt32Value((uint)System.Math.Max(0, bottom)); pgMar.Right = new UInt32Value((uint)System.Math.Max(0, top)); } } } } if (documentChanged) { docPart.Document.Save(); } } } } } Visual Basic ' Given a document name, set the print orientation for ' all the sections of the document. PublicSub SetPrintOrientation( ByVal fileName AsString, ByVal newOrientation As PageOrientationValues) Using document = WordprocessingDocument.Open(fileName, True) Dim documentChanged AsBoolean = FalseDim docPart = document.MainDocumentPart Dim sections = docPart.Document.Descendants(Of SectionProperties)() ForEach sectPr As SectionProperties In sections Dim pageOrientationChanged AsBoolean = FalseDim pgSz As PageSize = sectPr.Descendants(Of PageSize).FirstOrDefault If pgSz IsNot NothingThen ' No Orient property?

C. Word文檔怎麼將字體和數字變換方向

Word文檔將字體和數字變換方向的方法如下:

如圖所示,打開Word文檔,切換至「頁面布局」選項卡,單擊「文字方向」按鈕,展開下拉列表,單擊不同列表項(包括「水平」、「垂直」和「將文字元旋轉270°」),設置不同的文字方向,結果如下圖所示。

D. 怎樣把列印的文字橫著打

用WORD將文字橫著打的方法如下:

1、打開需要橫向列印的wold文檔。


E. 如何設置WORD中的字體方向

操作方法如下:

1、打開 辦公軟體 Word ,選擇文字右鍵;

F. 在word縱向列印中怎樣改變一個字的方向

如果想讓該字向左轉比較簡單:選中該字,在字體框的字體名稱前面加一個@回車,該字就向左轉了。
如果要向右、向下可插入藝術字,在藝術字格式中設置旋轉90°或者180°

G. 使用Word如何讓字體加大,變方向(橫向)

本文以win7系統word2016為例進行演示,具體步驟如下所示。

1、輸入需要編輯的文字,選中後選擇字體大小,這里可選擇的最大值為72。

H. 怎麼把字體改成這個方向列印出來

打開word ————選字————按滑鼠右鍵————文字方向

I. 如何設置文字列印方向,不是在WORD文檔裡面

打開word文檔,點擊word上面菜單欄的「頁面布局」,「文字方向」,在下拉菜單中點擊「垂直」。

J. 列印名字牌,文字方向怎麼調

1:打開需要列印的文檔,點擊「文件」→「列印(P)」→「列印」,不要選擇快速列印。快速列印都是默認值列印,不會彈出列印參數調試窗口;2:在彈出的「列印」設置對話框中,點擊「屬性(P)」一欄,對列印機進行參數設置;3:切換選項卡至「頁設置」,在頁面方向中可以選擇「縱向」和「橫向」,列印機默認是縱向,我們使用最多的也是縱向列印,這里我們更改為「橫向」,點擊「確認」退出;4:這時點擊列印,列印效果就是橫向的了。