c# - PDF Sharp, Image stretch across multiple page -
c# - PDF Sharp, Image stretch across multiple page -
im trying allow users save/view gantt chart using pdf sharp, problem when user selects many rows image gets compressed , unreadable, there way can allow/set image stretch across multiple pages?
so im creating 2 images combining them outputting pdf page, have tried setting page width higher didnt work.
bitmap bitmap = new bitmap(image.width + imagetest.width, math.max(image.height, imagetest.height)); using (graphics combineg = graphics.fromimage(bitmap)) { combineg.drawimage(imagetest, 0, 0); combineg.drawimage(image, imagetest.width, 0); } //convert pdf pdfdocument document = new pdfdocument(); document.info.title = "holiday_year " + year + "&quarter " + quarter; pdfpage page = document.addpage(); page.orientation = pdfsharp.pageorientation.landscape; xgraphics gfx = xgraphics.frompdfpage(page); xfont font = new xfont("verdana", 20, xfontstyle.bolditalic); gfx.drawimage(bitmap, new xrect(0, 100, page.width, 100)); gfx.drawstring("holiday - quarter " + quarter + " & year " + year, font, xbrushes.black, new xrect(0, 0, page.width, 40), xstringformats.center); byte[] filecontents = null; memorystream memorystream = new memorystream(); document.save(memorystream, true); filecontents = memorystream.toarray(); memorystream.close(); response.clear(); response.contenttype = "application/force-download"; response.addheader("content-disposition", "attachment; filename=iems-holiday.pdf"); response.binarywrite(filecontents); response.end();
to reply question: pdfsharp has no built-in feature allows images spread across multiple pages.
an image can drawn on several pages @ different positions, displaying different parts of image. after printing, these pages stitched together. image included in pdf file once
pdfsharp supports custom page sizes.
c# asp.net bitmap pdfsharp
Comments
Post a Comment