{"id":422,"date":"2023-11-20T16:55:16","date_gmt":"2023-11-20T08:55:16","guid":{"rendered":""},"modified":"2026-05-12T13:16:23","modified_gmt":"2026-05-12T05:16:23","slug":"article-slug-260","status":"publish","type":"post","link":"https:\/\/support.fuxinsoft.cn\/?p=422","title":{"rendered":"\u798f\u6615SDK\u5982\u4f55\u5b9e\u73b0\u5bf9PDF\u6307\u5b9a\u533a\u57df\u8fdb\u884c\u622a\u56fe\uff0c\u5e76\u8bbe\u7f6e\u5206\u8fa8\u7387\uff1f"},"content":{"rendered":"\n\n\n<p class=\"wp-block-paragraph\">C# \u4ee3\u7801\u5982\u4e0b<br>        static void renderABitmapAtRect(PDFPage page, RectF rectf, int dpiX, int dpiY)<br>        {<br>            float w = rectf.Width();<br>            float h = rectf.Height();<br>            float proX = (float)dpiX \/ 72;<br>            float proY = (float)dpiY \/ 72;<br>            int width = (int)(page.GetWidth() * proX);<br>            int height = (int)(page.GetHeight() * proY);<br>            rectf.left = rectf.left * proX;<br>            rectf.right = rectf.right * proX;<br>            rectf.bottom = rectf.bottom * proY;<br>            rectf.top = rectf.top * proY;<br><br>            Matrix2D matrix = page.GetDisplayMatrix(-(int)rectf.left, -(int)(height &#8211; rectf.top), width, height, 0);<br>            Bitmap bitmap = new Bitmap((int)rectf.Width(), (int)rectf.Height(), Bitmap.DIBFormat.e_DIBRgb, System.IntPtr.Zero, 0);<br>            bitmap.FillRect(0xFFFFFFFF, null);<br><br>            Renderer render = new Renderer(bitmap, false);<br>            \/\/\u5f00\u59cb\u6e32\u67d3<br>            render.StartRender(page, matrix, null);<br><br>            Image image = new Image();<br>            image.AddFrame(bitmap);<br>            image.SaveAs(&#8220;C:\\\\out\\\\111.png&#8221;);<br>            render.Dispose();<br>            bitmap.Dispose();<br><br>        }<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C# \u4ee3\u7801\u5982\u4e0b static void renderABitmapAtRect(PDFPage page, R [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[],"class_list":["post-422","post","type-post","status-publish","format-standard","hentry","category-gsdk"],"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","_links":{"self":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=422"}],"version-history":[{"count":3,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/422\/revisions"}],"predecessor-version":[{"id":8563,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=\/wp\/v2\/posts\/422\/revisions\/8563"}],"wp:attachment":[{"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.fuxinsoft.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}