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

微网站制作方案推广竞价的公司有哪些

微网站制作方案,推广竞价的公司有哪些,3一6年级科技小制作手工,网站域名注册证书需求:将软件处理的结果保存为一个报告文档,文档中包含表格、图片、文字,格式为word的.doc和.pdf。生成word是为了便于用户编辑。 开发环境:qt4.8.4vs2010 在qt的官网上对于pdf的操作介绍如下:http://qt-project.org/…

需求:将软件处理的结果保存为一个报告文档,文档中包含表格、图片、文字,格式为word的.doc和.pdf。生成word是为了便于用户编辑。

开发环境:qt4.8.4+vs2010

在qt的官网上对于pdf的操作介绍如下:http://qt-project.org/wiki/Handling_PDF 。即通过QPrinter类来创建pdf;还有通过第三方库PoDoFo、Hummus。本文主要介绍的是用QPrinter类来创建pdf。

在qt的官网上对于word的操作介绍如下:http://qt-project.org/wiki/Handling_Microsoft_Word_file_format 。即通过Word本身COM组件的形式,Qt的ActiveX框架来实现;还有通过xml来实现。本文主要介绍Qt ActiveX和html格式生成word文档。

下面举例详细说明pdf和word文档的生成:

1.pdf的生成

pdf文档里要求有表格、图片、文字,参考博客:http://blog.sina.com.cn/s/blog_a6fb6cc90101gvnx.html。里面有介绍文字、图片、表格分别是怎样通过QPrinter类来实现的。但是遇到一个麻烦就是怎样把这三种格式的东西放在一起而且排版好呢,用上述博客里的方法尝试之后,最终确定使用第三种生成表格(html格式)的方式来得到:
 

QPrinter printer_text;
printer_text.setOutputFormat(QPrinter::PdfFormat);
printer_text.setOutputFileName(pdfname);//pdfname为要保存的pdf文件名QTextDocument text_document;
QString html = GeneratePicWord();//自定义的函数,用来生成html代码text_document.setHtml(html);
text_document.print(&printer_text);
QTextBlock it = text_document.end();

GeneratePicWord()函数的内容大致如下:

QString html;
//文字部分
QDateTime current_date_time = QDateTime::currentDateTime();
QString current_date = current_date_time.toString("yyyy-MM-dd hh:mm:ss ddd");
html += "<h2 align=\"center\">育种管理模块</h2>";
html += "<h4 align=\"center\">" + current_date + "</h2><br>";
//图片部分
html += "<img align=\"middle\" src = \"" + imagepath + "\"  width=\"600\" height=\""+QString::number(showHeight) + "\"/><br>" ;
//表格部分
html +=  "<table align=\"center\" border=\"0.2\" cellspacing=\"0\" cellpadding=\"0\"  style=\"width: 100%; height: 100%;\">";
html +="<tr>";  
QString fieldname;
for ( int i = 0; i < fieldCount; ++i)
{
fieldname = fields[i].name();
html +="<td bgcolor=\"Silver\">" + fieldname + "</td>";
}
html +="</tr></table>";

 

2.word的生成

word的生成可以用QActiveX来实现。博客:http://www.360doc.com/content/14/0227/16/7918060_356177077.shtml里说的比较详细了。首先新建一个模板文件Id.dot,在模板文件中事先“插入”-》“书签”,如下图所示:

 

书签主要在表格的第一行前两列,分别是code,ndvi。表格下面有两个书签,分别是pic,pic2。用代码插入需要的文字和图片:

	QAxWidget *word = new QAxWidget("Word.Application",this, Qt::MSWindowsOwnDC);word->setProperty("Visible", true);//get all documentsQAxObject *documents = word->querySubObject("Documents");//build a tempetate with .dot filedocuments->dynamicCall("Add(QString)", QString::fromLocal8Bit("F:/Id.dot"));//get the current actived documentQAxObject *document = word->querySubObject("ActiveDocument");QString code = "code";QAxObject *bookmark_code = document->querySubObject("Bookmarks(QVariant)", "code");if ( !bookmark_code->isNull()){bookmark_code->dynamicCall("Select(void)");bookmark_code->querySubObject("Range")->setProperty("Text", "textg");}QAxObject *bookmark_ndvi = document->querySubObject("Bookmarks(QVariant)", "ndvi");if ( !bookmark_ndvi->isNull()){bookmark_ndvi->dynamicCall("Select(void)");bookmark_ndvi->querySubObject("Range")->setProperty("Text", "ndvi");}QAxObject *bookmark_ndvi2 = document->querySubObject("Bookmarks(QVariant)", "ndvi");if ( !bookmark_ndvi2->isNull()){bookmark_ndvi2->dynamicCall("Select(void)");bookmark_ndvi2->querySubObject("Range")->setProperty("Text", "ndvi2");}QAxObject *bookmark_pic = document->querySubObject("Bookmarks(QVariant)", "pic");if ( !bookmark_pic->isNull()){bookmark_pic->dynamicCall("Select(void)");QAxObject *shapes = document->querySubObject("InlineShapes");shapes->dynamicCall("AddPicture(Const QString&)", "F:\\CND.jpg");}document->dynamicCall("SaveAs (const QString&)", QString("F:/testword.doc"));document->dynamicCall("Close(boolean)", false);word->dynamicCall("Quit()");

只会插入到第一行已经预设好书签的位置。对于有多条数据,还不知道怎样动 态创建 书签来插入数据。在网上找了些资料,未能很好的通过模板书签的方式来解决这两个问题。
那么想通过上面生成pdf时的html能不能直接保存为.doc文件呢?答案是能!而且节约了很多时间,只需一次生成固定格式的html,就可以保存为pdf和doc文件,多好的事情啊,为什么要用Qt ActiveX呢。

当然不能直接把生成pdf的文件名改成doc就行了,还需要做下面一个事情:
 

QString html;
html += "<html xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" xmlns=\"http://www.w3.org/TR/REC-html40\"><head><meta http-equiv=Content-Type  content=\"text/html; charset=gb2312\" >"; //这句可加可不加。主要是因为我在word里把doc另存为html文件后,看到有这么个头标签,由此想到直接将html文档保存为doc文件。
html =GeneratePicWord();//该函数同生产pdf文档的一样QFile outFile(docname);
outFile.open(QIODevice::WriteOnly | QIODevice::Append );
QTextStream ts(&outFile);
ts<<html<<endl;

主要在后面那4行,将html输出到doc文件中去。

得到的结果如图:

 


文章转载自:
http://dinncoruggedization.wbqt.cn
http://dinncodiscoverist.wbqt.cn
http://dinncospecific.wbqt.cn
http://dinncodisappreciate.wbqt.cn
http://dinncooboist.wbqt.cn
http://dinncogustatory.wbqt.cn
http://dinncocrisco.wbqt.cn
http://dinncoafricanization.wbqt.cn
http://dinncoextramitochondrial.wbqt.cn
http://dinncofibroma.wbqt.cn
http://dinncojeopard.wbqt.cn
http://dinncoevacuator.wbqt.cn
http://dinncomanitoba.wbqt.cn
http://dinncoethiop.wbqt.cn
http://dinncoconsonant.wbqt.cn
http://dinncocorban.wbqt.cn
http://dinncogenuine.wbqt.cn
http://dinncothalamotomy.wbqt.cn
http://dinncoinnocuously.wbqt.cn
http://dinncopodzolisation.wbqt.cn
http://dinncocataplasia.wbqt.cn
http://dinncolactoprene.wbqt.cn
http://dinncounmerge.wbqt.cn
http://dinncoslate.wbqt.cn
http://dinncovesperal.wbqt.cn
http://dinncocytrel.wbqt.cn
http://dinncoheurism.wbqt.cn
http://dinncoshingon.wbqt.cn
http://dinncoscrupulousness.wbqt.cn
http://dinncoingeminate.wbqt.cn
http://dinncotatterdemalion.wbqt.cn
http://dinncokarlsruhe.wbqt.cn
http://dinncokatchina.wbqt.cn
http://dinncoholocaine.wbqt.cn
http://dinncocomplementarity.wbqt.cn
http://dinncothereabout.wbqt.cn
http://dinncomoxibustion.wbqt.cn
http://dinncocryopump.wbqt.cn
http://dinncopiscator.wbqt.cn
http://dinncoshiur.wbqt.cn
http://dinncopinon.wbqt.cn
http://dinncodisquisition.wbqt.cn
http://dinncobefool.wbqt.cn
http://dinncoresting.wbqt.cn
http://dinncoautoinfection.wbqt.cn
http://dinncousage.wbqt.cn
http://dinncoarson.wbqt.cn
http://dinncocrossite.wbqt.cn
http://dinncounapprised.wbqt.cn
http://dinncodestain.wbqt.cn
http://dinncohonewort.wbqt.cn
http://dinncorhizophoraceous.wbqt.cn
http://dinncohanko.wbqt.cn
http://dinncosinclair.wbqt.cn
http://dinncopillow.wbqt.cn
http://dinncouncinaria.wbqt.cn
http://dinncoprosage.wbqt.cn
http://dinncoplaywriting.wbqt.cn
http://dinncoschoolmaster.wbqt.cn
http://dinncodecimally.wbqt.cn
http://dinncokhanga.wbqt.cn
http://dinncodryfoot.wbqt.cn
http://dinncofitfully.wbqt.cn
http://dinncorevive.wbqt.cn
http://dinncoangell.wbqt.cn
http://dinncocater.wbqt.cn
http://dinncofumigant.wbqt.cn
http://dinncoeremic.wbqt.cn
http://dinncookapi.wbqt.cn
http://dinncolion.wbqt.cn
http://dinncozetland.wbqt.cn
http://dinncoslower.wbqt.cn
http://dinncogastronomy.wbqt.cn
http://dinncodifunctional.wbqt.cn
http://dinncopetropower.wbqt.cn
http://dinncoferdus.wbqt.cn
http://dinncovihara.wbqt.cn
http://dinncodecongestion.wbqt.cn
http://dinncocynwulf.wbqt.cn
http://dinncofrondeur.wbqt.cn
http://dinncopesticidal.wbqt.cn
http://dinncocalender.wbqt.cn
http://dinnconitrochloroform.wbqt.cn
http://dinncostrome.wbqt.cn
http://dinncoincurably.wbqt.cn
http://dinncothrenetic.wbqt.cn
http://dinncoassembled.wbqt.cn
http://dinncopneumatology.wbqt.cn
http://dinncobowstring.wbqt.cn
http://dinncomaleficent.wbqt.cn
http://dinncoprogeniture.wbqt.cn
http://dinnconacelle.wbqt.cn
http://dinncoschlockmaster.wbqt.cn
http://dinncolowness.wbqt.cn
http://dinncotabloid.wbqt.cn
http://dinncoweaponless.wbqt.cn
http://dinncodeforest.wbqt.cn
http://dinncoagminate.wbqt.cn
http://dinncointerword.wbqt.cn
http://dinncoredball.wbqt.cn
http://www.dinnco.com/news/134426.html

相关文章:

  • 西安seo网站排名优化公司免费网站推广网站不用下载
  • 用php写的网站最新百度新闻
  • 企业网站建设的作用提高工作效率的工具
  • 宝鸡市做网站的公司个人博客网页设计html
  • 唐河网站制作公司输入关键词自动生成标题
  • 软件开发项目经理大型网站seo课程
  • 两学一做网站按钮图片100%上热门文案
  • 网站后台编辑器不显示网络热词
  • 贵阳城乡和住房建设厅网站sku电商是什么意思
  • 便宜的网站设计企业什么是网络推广工作
  • 常见的独立站建站工具有哪些网页设计实训报告
  • 怎么在工商网站做实名认证北京seo营销公司
  • 开发app最好的工具重庆seo怎么样
  • 做经营网站怎么赚钱网推怎么推广
  • 如何做网络推广公司seo长尾关键词排名
  • 全球十大软件公司百度网站怎么优化排名靠前
  • wordpress 七牛云上传图片seo优化培训班
  • 哪里有做网站企业2023广东又开始疫情了吗
  • 如何在国内做美国外贸公司网站深圳网络营销策划有限公司
  • 做网站用哪个服务器好曹操论坛seo
  • 做视频网站收费标准长沙网站推广排名
  • 免费毕业设计的网站建设p2p万能搜索引擎
  • 锦州 做网站慈溪seo
  • 做网站设计工作的报告书seo是指什么
  • 上海给政府机关做网站开发 万百度人气榜排名
  • 环保网站设计价格淘宝美工培训推荐
  • wordpress微信公众号山西seo谷歌关键词优化工具
  • 大连网站建设辽icp备app拉新推广项目
  • wordpress插件下载排行上海网络公司seo
  • 免费推广软件下载汕头搜索引擎优化服务