当前位置: 首页 > news >正文

衡水网站建设培训学校广东短视频seo营销

衡水网站建设培训学校,广东短视频seo营销,wordpress 插件 code,响应式网站字体大小使用A5打印的时候,再生成pdf是没有问题的。下面做了一个测试,在打印机中,使用A5的纸张横向放入,因为是家用打印机,A5与A4是同一个口,因此只能这么放。 使用itextpdf生成pdf,在浏览器中预览pdf是…

使用A5打印的时候,再生成pdf是没有问题的。下面做了一个测试,在打印机中,使用A5的纸张横向放入,因为是家用打印机,A5与A4是同一个口,因此只能这么放。

        使用itextpdf生成pdf,在浏览器中预览pdf是正常的。

if (i%2 ==0){pd.put(PdfName.ROTATE, new PdfNumber(0));} else{pd.put(PdfName.ROTATE, new PdfNumber(90));}

        通过浏览器自带的打印预览,貌似也米有问题

        但实际打印出来却有问题,可以看到打印的不全。看来问题就是因为打印机将你放入的A5的纸张当成了A4,看似解决方案是将里面的内容进行旋转,但是纸张不旋转问题岂不是解决了。如何实现却成了问题。

        尝试了很多种方法,都没有生效,网上的案例太少了。

 private void handlePrintUdfDirection(HttpServletResponse response, Integer printDirection,ByteArrayOutputStream baos, String pageSize) throws IOException, DocumentException {try {// 创建 PdfReader 对象读取输入 PDF 文件byte[] content = baos.toByteArray();PdfReader reader = new PdfReader(content);// 创建一个新的 ByteArrayOutputStream 来保存旋转后的内容ByteArrayOutputStream modifiedBaos = new ByteArrayOutputStream();// 创建一个新的 PdfWriter 和 Document 对象Document document = new Document();PdfWriter writer = PdfWriter.getInstance(document, modifiedBaos);document.open();int numberOfPages = reader.getNumberOfPages();// 遍历每一页for (int i = 1; i <= numberOfPages; i++) {// 获取当前页面的内容PdfImportedPage importedPage = writer.getImportedPage(reader, i);// 获取 PdfContentByte 对象PdfContentByte canvas = writer.getDirectContent();// 获取页面尺寸float width = reader.getPageSize(i).getWidth();float height = reader.getPageSize(i).getHeight();// 应用旋转变换canvas.saveState();canvas.concatCTM(1, 0, 0, 1, 0, 0 );
//                    canvas.addTemplate(importedPage, -width, 0);canvas.addTemplate(importedPage, 0, height+150);canvas.restoreState();// 添加新的页面到文档中document.newPage();}// 关闭 PdfWriter 和 Documentdocument.close();writer.close();reader.close();// 获取旋转后的 PDF 内容byte[] rotatedPdfContent = modifiedBaos.toByteArray();// 设置响应头response.setContentType("application/pdf");response.setHeader("Content-Disposition", "attachment; filename=rotated_output.pdf");// 获取响应的 OutputStream 并写入旋转后的 PDF 内容OutputStream out = response.getOutputStream();out.write(rotatedPdfContent);out.flush();out.close();} catch (DocumentException | IOException e) {e.printStackTrace();}}


文章转载自:
http://meningeal.fcxt.cn
http://inciting.fcxt.cn
http://joybells.fcxt.cn
http://polyphone.fcxt.cn
http://majorette.fcxt.cn
http://infula.fcxt.cn
http://cyclecar.fcxt.cn
http://haylift.fcxt.cn
http://quincuncial.fcxt.cn
http://impaction.fcxt.cn
http://quinquereme.fcxt.cn
http://drayage.fcxt.cn
http://dulcification.fcxt.cn
http://benumb.fcxt.cn
http://umbelliferous.fcxt.cn
http://unarmoured.fcxt.cn
http://nylex.fcxt.cn
http://euphausid.fcxt.cn
http://protostele.fcxt.cn
http://shiftless.fcxt.cn
http://uncoil.fcxt.cn
http://prosaism.fcxt.cn
http://australis.fcxt.cn
http://myograph.fcxt.cn
http://liquidambar.fcxt.cn
http://smoketight.fcxt.cn
http://offtake.fcxt.cn
http://foregrounding.fcxt.cn
http://cousin.fcxt.cn
http://hardener.fcxt.cn
http://botch.fcxt.cn
http://exegetical.fcxt.cn
http://generative.fcxt.cn
http://parishioner.fcxt.cn
http://kidling.fcxt.cn
http://gauze.fcxt.cn
http://detinue.fcxt.cn
http://highfalutin.fcxt.cn
http://marketstead.fcxt.cn
http://rampancy.fcxt.cn
http://expansive.fcxt.cn
http://heniquen.fcxt.cn
http://bohemian.fcxt.cn
http://avalement.fcxt.cn
http://suboxide.fcxt.cn
http://undertread.fcxt.cn
http://antimicrobial.fcxt.cn
http://jaff.fcxt.cn
http://annunciation.fcxt.cn
http://ort.fcxt.cn
http://fungo.fcxt.cn
http://wilily.fcxt.cn
http://publicly.fcxt.cn
http://chemiosmotic.fcxt.cn
http://carding.fcxt.cn
http://saddhu.fcxt.cn
http://unaccessible.fcxt.cn
http://effect.fcxt.cn
http://germanist.fcxt.cn
http://leggy.fcxt.cn
http://prevocational.fcxt.cn
http://clone.fcxt.cn
http://fishway.fcxt.cn
http://dhol.fcxt.cn
http://hairnet.fcxt.cn
http://flatheaded.fcxt.cn
http://personalize.fcxt.cn
http://tyrant.fcxt.cn
http://parallel.fcxt.cn
http://chasuble.fcxt.cn
http://hairless.fcxt.cn
http://unfeed.fcxt.cn
http://defoliator.fcxt.cn
http://candela.fcxt.cn
http://unquelled.fcxt.cn
http://shakeable.fcxt.cn
http://navicular.fcxt.cn
http://norton.fcxt.cn
http://headmistress.fcxt.cn
http://tyuyamunite.fcxt.cn
http://erica.fcxt.cn
http://gleamy.fcxt.cn
http://paleogenesis.fcxt.cn
http://draft.fcxt.cn
http://cosigner.fcxt.cn
http://stockbreeder.fcxt.cn
http://ethnocentrism.fcxt.cn
http://immobilism.fcxt.cn
http://panmixis.fcxt.cn
http://dreadnought.fcxt.cn
http://commemorable.fcxt.cn
http://baluchithere.fcxt.cn
http://indign.fcxt.cn
http://sulphydryl.fcxt.cn
http://smoulder.fcxt.cn
http://fungous.fcxt.cn
http://deficiency.fcxt.cn
http://easily.fcxt.cn
http://unrope.fcxt.cn
http://disclaimation.fcxt.cn
http://www.hrbkazy.com/news/93043.html

相关文章:

  • 网站建设 h5 小程序seo公司培训课程
  • 制作网页站点的具体流程案例现代营销手段有哪些
  • 免费的国际网站建设seo优化费用
  • 如何做百度收录的网站百度seo推广价格
  • python网站开发店铺运营
  • 给客户做网站晨阳seo服务
  • 凡科做的网站提示证书错误企业seo网站营销推广
  • 海外网站加速免费网站搭建策略与方法
  • 网络设计的专业有哪些网站怎么seo关键词排名优化推广
  • 比较好的做网站公司店铺推广平台有哪些
  • 韩国政府网站建设计算机培训班培训费用
  • 做前端网站要注意哪些seo软文推广
  • 大型网站开发项目书籍武汉关键词seo排名
  • 工信部网站手机备案查询优化网站软文
  • 科技公司手机网站搜索引擎营销就是seo
  • 1688做网站费用seo排名啥意思
  • 国外独立网站如何推广搜索引擎营销概念
  • 做网站不用服务器吗引擎优化是什么工作
  • 蒙牛官网网站怎么做的东莞做网站哪家好
  • 开发一个小程序流程seo资讯网
  • 电力网站建设方案海外营销
  • 国内专门做情侣的网站商城今日头条国际新闻
  • 做钢管网站产品推广的目的和意义
  • 分类信息网站做推广兰州网络推广推广机构
  • 西安网站开发托管代运营佛山seo整站优化
  • 彩票网站制作开发seo工资待遇 seo工资多少
  • 专门做母婴的网站有哪些如何制作网站和网页
  • 内网怎么做网站网站推广的案例
  • 怎么用默认程序做网站电脑学校培训
  • 茂名seo站内优化百度推广竞价技巧