3
A
回答
6
我在爲自己調查iTextSharp時發現了這段代碼片段,發現有2個人提及Open Actions。我已在下面包含http://www.developerbarn.com/blogs/richyrich-33.htm的片段:
PdfWriter writer = PdfWriter.GetInstance(doc, HttpContext.Current.Response.OutputStream);
//this creates a new destination to send the action to when the document is opened. The zoom in this instance is set to 0.75f (75%). Again I use doc.PageSize.Height to set the y coordinate to the top of the page. PdfDestination.XYZ is a specific PdfDestination Type that allows us to set the location and zoom.
PdfDestination pdfDest = new PdfDestination(PdfDestination.XYZ, 0, doc.PageSize.Height, 0.75f);
//open our document
doc.Open();
//here you put all the information you want to write to your PDF
//create a new action to send the document to our new destination.
PdfAction action = PdfAction.GotoLocalPage(1, pdfDest, writer);
//set the open action for our writer object
writer.SetOpenAction(action);
//finally, close our document
doc.Close();
相關問題
- 1. 設置默認縮放
- 2. 當默認不是100時,在Selenium WebDriver中設置縮放級別爲100%
- 3. D3 - 設置雙擊的縮放比例
- 4. 在AmChart中設置默認縮放
- 5. 如何設置用戶控件的相對縮放比例?
- 6. Qt OpenGL默認縮放比例真的很奇怪
- 7. Chrome響應式仿真器 - 如何將默認縮放至100%
- 8. 如何設置加載JSON圖層的最小縮放比例?
- 9. 如何動態設置c3圖表的y軸縮放比例?
- 10. 如何在android google map中設置默認縮放級別?
- 11. 如何在Android WebView中設置縮放比例
- 12. 如何使用Root.plist的默認設置?
- 13. TKinter:如何將我的滑塊的默認值設置爲100?
- 14. 如何在iPhone上更改方向更改時重置Web應用程序的縮放比例/縮放比例?
- 15. 當我更改默認縮放設置時,Google Maps JavaScript API不縮放
- 16. 如何檢測UIWebView的縮放比例
- 17. CSS圖像的容器縮放比例高度爲100%
- 18. 如何設置Datetimepicker的默認設置?
- 19. 設置iOS模擬器的默認比例
- 20. 使用JavaScript整個SVG縮放比例
- 21. Maxscript中的縮放比例
- 22. 設置UIScrollView縮放比例以適合屏幕
- 23. 如何啓用縮放控件並縮小WebView中的縮放比例?
- 24. 如何設置默認baseUrl
- 25. 如何設置默認值?
- 26. 每次重繪後設置縮放比例
- 27. 如何停止比例圖像縮放?
- 28. 是否有可能在android studio中爲編輯器設置默認縮放比例?
- 29. 使用JavaScript/onorientationchange重置iPhone上Safari的比例/寬度/縮放
- 30. 如何使用HighChart更改軸的縮放比例