当前位置:首页 > 代码 > 正文

网页pdf代码(pdf在线编辑网页版)

admin 发布:2022-12-23 00:00 86


今天给各位分享网页pdf代码的知识,其中也会对pdf在线编辑网页版进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

网页打开本地pdf文件 在设计网页时,用什么HTML代码打开本地的pdf文件?

1、function print_onclick(url)

{

var a=window.open(url, "_blank","top=200,left=200,height=600,width=800,status=yes,toolbar=1,menubar=no,location=no,scrollbars=yes");

}

2、

a href="a.pdf"点击此处打开PDF/a a.pdf可以改成你需要的文件。

java怎样将网页上面的数据以pdf的格式导出,求代码

需要用到一个pdf的jar包,去网上下载一个itextpdf.jar。导出pdf的格式都是需要自己用代码实现的,每一行 ,每一个列是什么格式,都需要自己写出来,是不能够自动生成的,反正很麻烦。我做的一个导出成pdf特定格式的东西,写了好几千行代码。相当头痛。

package com.dw.mqs.export;

import java.awt.Color;

import java.io.ByteArrayOutputStream;

import java.math.BigDecimal;

import java.net.URL;

import java.util.Date;

import java.util.HashSet;

import java.util.Hashtable;

import java.util.List;

import java.util.Map;

import java.util.Set;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import com.dw.file.WebHelper;

import com.dw.mqs.MqsManager;

import com.dw.mqs.MqsUtilNew;

import com.dw.mqs.ProductItem;

import com.dw.mqs.ProjectBasicItem;

import com.dw.mqs.ProjectConfDetailItem;

import com.dw.mqs.ProjectConfVerItem;

import com.dw.mqs.ProjectConfig;

import com.dw.mqs.ProjectService;

import com.dw.mqs.Util;

import com.dw.system.Convert;

import com.dw.system.gdb.DBResult;

import com.dw.system.gdb.DataRow;

import com.dw.system.gdb.GDB;

import com.dw.user.User;

import com.dw.user.UserManager;

import com.dw.user.UserProfile;

import com.lowagie.text.Document;

import com.lowagie.text.Element;

import com.lowagie.text.Font;

import com.lowagie.text.Image;

import com.lowagie.text.PageSize;

import com.lowagie.text.Paragraph;

import com.lowagie.text.Rectangle;

import com.lowagie.text.pdf.BaseFont;

import com.lowagie.text.pdf.PdfPCell;

import com.lowagie.text.pdf.PdfPTable;

import com.lowagie.text.pdf.PdfWriter;

public class PdfService

{

Document document = new Document(PageSize.A4.rotate(), 50, 50, 50, 50);

ByteArrayOutputStream os = new ByteArrayOutputStream();

PdfWriter pdf = PdfWriter.getInstance(document, os);

Rectangle rect = new Rectangle(36, 54, 559, 788);

pdf.setBoxSize("art", rect);

pdf.setPageEvent(new TableHeader());

document.open();

BaseFont baseArialuni = BaseFont.createFont("res/ARIALUNI.TTF",

BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); // Arial

// unicode字体

Font fontCN = new Font(baseArialuni, 9, Font.NORMAL, Color.BLACK);

Font fontCN8b = new Font(baseArialuni, 9, Font.BOLD, Color.BLACK);

Font fontCN12b = new Font(baseArialuni, 12, Font.BOLD, Color.BLACK);

Font fontCN9b = new Font(baseArialuni, 10, Font.BOLD, Color.BLACK);

Font fontCN9 = new Font(baseArialuni, 10, Font.NORMAL, Color.BLACK);

Font fontCN9b_blue = new Font(baseArialuni, 10, Font.BOLD, Color.BLUE);

PdfPTable table = null;

PdfPCell cell = null;

table = new PdfPTable(relativeWidths);

table.setWidthPercentage(100);

cell = new PdfPCell(new Paragraph(tit + "标题", fontCN12b));

cell.setColspan(root ? 12 : 10);

cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 水平居中

cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 垂直居中

cell.setBorder(Rectangle.NO_BORDER);

table.addCell(cell);

}

如何在浏览器中打开PDF文件并实现预览的思路与代码

其实也就是简单的在浏览器中实现一个打开pdf文件,并有类似预览功能的边框。其实在网上经常见到类似的页面,在浏览器中打开pdf文档,可大部分都是由于版权的原因使用了一些很特殊的技术,自然很难模仿了。即使有直接在浏览器打开的例子,也必须手动点击一下链接然后才能打开pdf文件。如何直接打开,而不用点击链接呢?本以为自己对js很熟,也就使用js模拟点击,可就是不管用,没办法,只能在网上继续寻找资料。最终想不到代码却很简单。最主要的是使用到了一个jquery的插件jquery.media.js,使用这个插件就很容易实现了。核心代码:html xmlns="/1999/xhtml" head runat="server" meta content="IE=7.0000" http-equiv="X-UA-Compatible"/ titlepdf阅读/title script type="text/javascript" src="pdfview_files/jquery-1.7.2.min.js"/script script type="text/javascript" src="pdfview_files/jquery.media.js"/script script type="text/javascript" $(function () { $('a.media').media({ width: 800, height: 800 }); }); /script /head body form id="form1" runat="server" div id="main" a class="media" href="../../灾害性天气典型个例/暴雨/河套西部一次局地大暴雨成因分析.pdf" id="PDFFile" 河套西部一次局地大暴雨成因分析/a /div /form /body /html 使用jquery.media.js就可以直接把一个连接到pdf文件的链接打开

求用PDF在网页里显示的代码(c#.net)

html 默认:meta http-equiv="Content-Type" content="text/html; charset=utf-8" /

pdf :

meta http-equiv="Content-Type" content="application/pdf; charset=utf-8" /

html 的 ContentType

ContentTypes : "ez","application/andrew-inset"

ContentTypes : "hqx","application/mac-binhex40"

ContentTypes : "cpt","application/mac-compactpro"

ContentTypes : "doc","application/msword"

ContentTypes : "bin","application/octet-stream"

ContentTypes : "dms","application/octet-stream"

ContentTypes : "lha","application/octet-stream"

ContentTypes : "lzh","application/octet-stream"

ContentTypes : "exe","application/octet-stream"

ContentTypes : "class","application/octet-stream"

ContentTypes : "so","application/octet-stream"

ContentTypes : "dll","application/octet-stream"

ContentTypes : "oda","application/oda"

ContentTypes : "pdf","application/pdf"

ContentTypes : "ai","application/postscript"

ContentTypes : "eps","application/postscript"

ContentTypes : "ps","application/postscript"

ContentTypes : "smi","application/smil"

ContentTypes : "smil","application/smil"

ContentTypes : "mif","application/vnd.mif"

ContentTypes : "xls","application/vnd.ms-excel"

ContentTypes : "ppt","application/vnd.ms-powerpoint"

ContentTypes : "wbxml","application/vnd.wap.wbxml"

ContentTypes : "wmlc","application/vnd.wap.wmlc"

ContentTypes : "wmlsc","application/vnd.wap.wmlscriptc"

ContentTypes : "bcpio","application/x-bcpio"

ContentTypes : "vcd","application/x-cdlink"

ContentTypes : "pgn","application/x-chess-pgn"

ContentTypes : "cpio","application/x-cpio"

ContentTypes : "csh","application/x-csh"

ContentTypes : "dcr","application/x-director"

ContentTypes : "dir","application/x-director"

ContentTypes : "dxr","application/x-director"

ContentTypes : "dvi","application/x-dvi"

ContentTypes : "spl","application/x-futuresplash"

ContentTypes : "gtar","application/x-gtar"

ContentTypes : "hdf","application/x-hdf"

ContentTypes : "js","application/x-javascript"

ContentTypes : "skp","application/x-koan"

ContentTypes : "skd","application/x-koan"

ContentTypes : "skt","application/x-koan"

ContentTypes : "skm","application/x-koan"

ContentTypes : "latex","application/x-latex"

ContentTypes : "nc","application/x-netcdf"

ContentTypes : "cdf","application/x-netcdf"

ContentTypes : "sh","application/x-sh"

ContentTypes : "shar","application/x-shar"

ContentTypes : "swf","application/x-shockwave-flash"

ContentTypes : "sit","application/x-stuffit"

ContentTypes : "sv4cpio","application/x-sv4cpio"

ContentTypes : "sv4crc","application/x-sv4crc"

ContentTypes : "tar","application/x-tar"

ContentTypes : "tcl","application/x-tcl"

ContentTypes : "tex","application/x-tex"

ContentTypes : "texinfo","application/x-texinfo"

ContentTypes : "texi","application/x-texinfo"

ContentTypes : "t","application/x-troff"

ContentTypes : "tr","application/x-troff"

ContentTypes : "roff","application/x-troff"

ContentTypes : "man","application/x-troff-man"

ContentTypes : "me","application/x-troff-me"

ContentTypes : "ms","application/x-troff-ms"

ContentTypes : "ustar","application/x-ustar"

ContentTypes : "src","application/x-wais-source"

ContentTypes : "xhtml","application/xhtml+xml"

ContentTypes : "xht","application/xhtml+xml"

ContentTypes : "zip","application/zip"

ContentTypes : "au","audio/basic"

ContentTypes : "snd","audio/basic"

ContentTypes : "mid","audio/midi"

ContentTypes : "midi","audio/midi"

ContentTypes : "kar","audio/midi"

ContentTypes : "mpga","audio/mpeg"

ContentTypes : "mp2","audio/mpeg"

ContentTypes : "mp3","audio/mpeg"

ContentTypes : "aif","audio/x-aiff"

ContentTypes : "aiff","audio/x-aiff"

ContentTypes : "aifc","audio/x-aiff"

ContentTypes : "m3u","audio/x-mpegurl"

ContentTypes : "ram","audio/x-pn-realaudio"

ContentTypes : "rm","audio/x-pn-realaudio"

ContentTypes : "rpm","audio/x-pn-realaudio-plugin"

ContentTypes : "ra","audio/x-realaudio"

ContentTypes : "wav","audio/x-wav"

ContentTypes : "pdb","chemical/x-pdb"

ContentTypes : "xyz","chemical/x-xyz"

ContentTypes : "bmp","image/bmp"

ContentTypes : "gif","image/gif"

ContentTypes : "ief","image/ief"

ContentTypes : "jpeg","image/jpeg"

ContentTypes : "jpg","image/jpeg"

ContentTypes : "jpe","image/jpeg"

ContentTypes : "png","image/png"

ContentTypes : "tiff","image/tiff"

ContentTypes : "tif","image/tiff"

ContentTypes : "djvu","image/vnd.djvu"

ContentTypes : "djv","image/vnd.djvu"

ContentTypes : "wbmp","image/vnd.wap.wbmp"

ContentTypes : "ras","image/x-cmu-raster"

ContentTypes : "pnm","image/x-portable-anymap"

ContentTypes : "pbm","image/x-portable-bitmap"

ContentTypes : "pgm","image/x-portable-graymap"

ContentTypes : "ppm","image/x-portable-pixmap"

ContentTypes : "rgb","image/x-rgb"

ContentTypes : "xbm","image/x-xbitmap"

ContentTypes : "xpm","image/x-xpixmap"

ContentTypes : "xwd","image/x-xwindowdump"

ContentTypes : "igs","model/iges"

ContentTypes : "iges","model/iges"

ContentTypes : "msh","model/mesh"

ContentTypes : "mesh","model/mesh"

ContentTypes : "silo","model/mesh"

ContentTypes : "wrl","model/vrml"

ContentTypes : "vrml","model/vrml"

ContentTypes : "css","text/css"

ContentTypes : "html","text/html"

ContentTypes : "htm","text/html"

ContentTypes : "asc","text/plain"

ContentTypes : "txt","text/plain"

ContentTypes : "rtx","text/richtext"

ContentTypes : "rtf","text/rtf"

ContentTypes : "sgml","text/sgml"

ContentTypes : "sgm","text/sgml"

ContentTypes : "tsv","text/tab-separated-values"

ContentTypes : "wml","text/vnd.wap.wml"

ContentTypes : "wmls","text/vnd.wap.wmlscript"

ContentTypes : "etx","text/x-setext"

ContentTypes : "xsl","text/xml"

ContentTypes : "xml","text/xml"

ContentTypes : "mpeg","video/mpeg"

ContentTypes : "mpg","video/mpeg"

ContentTypes : "mpe","video/mpeg"

ContentTypes : "qt","video/quicktime"

ContentTypes : "mov","video/quicktime"

ContentTypes : "mxu","video/vnd.mpegurl"

ContentTypes : "avi","video/x-msvideo"

ContentTypes : "movie","video/x-sgi-movie"

ContentTypes : "ice","x-conference/x-cooltalk"

ContentTypes : "form","application/x-www-form-urlencoded"

如何下载网页内嵌的PDF文件

先说下很简单,每个人看完都能完成,下面举实例:

1、我要下载这个PDF文件,但没办法直接下载,如图一;

图一

2、所以我查看源代码(快捷键:ctrl+u),搜索“pdf”找到文件对应的链接,如图二;

图二

3、复制这个链接在新窗口打开,注意看栏目,有些会出现直接下载的;我们这个没有直接下载的,所以还要进行下面的操作

图三

4、继续查看pdf页面的源代码(快捷键:ctrl+u),搜索“pdf”(快捷键:ctrl+f)找到pdf文件对应的链接;

图四

5、复制刚才找到的链接,在新窗口打开,打开后如图五,会发现现在pdf文件可以直接下载,点击下载后修改下文件名字即可。

图五

打开页面的原代码——找到pdf文件链接——再次查看源代码,找到index文件对应的链接——新窗口打开链接——点击下载。

网页pdf代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于pdf在线编辑网页版、网页pdf代码的信息别忘了在本站进行查找喔。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/32259.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载