What is the Pixels size of a PDF Page?
A standard PDF page is defined as a portrait Letter Document of 8.5" by 11", I have defined 110 Pixels per inch as the resolution of the PDF document, therefore: 8.5 * 110 = 935 Width by 11 * 110 = 1210 Height. (Standard Page = 935 Pixels by 1210 pixels).
What is the difference between the Client and Server versions of PDF?
Note: the 110 Pixels per inch was selected as a best match to the screen resolution. This is a very arbutary number, since screens come in a varity of pixels per inch resoltions. The internal units of the PDF document are Points (72 units per inch), so I selected a resolution that better matched what the browser displayed to the paper output. Also NOTE: unlike the Screen resolution, the PDF resolution is real numbers, therefore you can specify factional units, for example a font-size=4.5px is valid
The server version uses ActiveX ADO Stream and the FileSystemObject to perform
disk I/O. The client version will only read files from the server using the XmlHttp
browser function.
The client version has no security restrictions and can be ran from all levels
of security on the client. You should never use the client version on the server,
it just does not have the I/O capabilities needed. You can use the server version on the client if you lower the browser's security to allow activeX
to run
How do I create a 3D image?
You can use Google's
Sketch-up to
create the 3D image and then Save-AS to a .DAE 3D image format, then using
the MeshLab program
import the .DAE file and then immediately export the file as a .U3D. The
.U3D file goes into the PDF document as a dynamic 3D image <IMG SRC="sample.u3d">
(all free). The 3D .DAE (COLLADA) format is an XML ascii text file, I was able
to generate my 3D network model into this
format, then used MeshLab to create the U3D form
click HERE to see my (crude) 3D
network model builder
Can I Use True-Type FONTS in the PDF?
You can use True-Type Fonts by
converting them to TYPE 1 Postscript fonts. I tried the program FontXChange by Fontgear
(http://www.fontgear.net/fontxchange.html) and this seemed to have worked. Make sure
you read the License on the font files before you include them in a PDF document, there are
generally license restrictions
on the use of fonts by their owners.
How do I add a captured signature to the PDF?
htmlData += '<center><img src="Canvas:myCanvas" height=200></center>'; window.location.href = CollinsPDF('return as=DataURL',htmlData); Click HERE to open A 100% Client side example to draw on canvas using mouse, and converting the canvas to PDF Use: Chrome, IE9, Safari, Opera ... How do I add a Google Map to the PDF? var url = ""; url += "http://maps.google.com/maps/api/staticmap?"; url += "center=Brooklyn+Bridge,New+York,NY"; url += "&zoom=14"; url += "&size=512x512"; url += "&maptype=roadmap"; url += "&markers=color:blue|label:S|40.702147,-74.015794"; url += "&markers=color:green|label:G|40.711614,-74.012318"; url += "&markers=color:red|color:red|label:C|40.718217,-73.998284"; url += "&sensor=false"; url += "&key=your-key-code"; url += "&format=jpg"; Server Side: htmlData = "<center><img src='" + url + "'></center>"; CollinsPDF('',htmlData); Client Side: window.image = document.createElement('img'); window.image.src = url; window.image.onload = onLoadImage_openAsPdf; function onLoadImage_openAsPdf() { htmlData = '<center><img src="{defer:window.image.toData()}"></center>'; window.location.href = CollinsPDF('return as=DataURL',htmlData); } The HTML does not page break, why?
You must put in page break tags as needed. Example: "Hello<Pagebreak>World"
Can I use PDF with ASP.NET?
HTML does not have natural page breaks; it is designed as a single page document, as such there are no absolute page boundaries and far too many cases where a page break is impossible to be determined. I could page break like an image where text would be split across page boundaries, I decided this has no real use. It is best for the designer to determine where in the HTML to place page breaks. There are a few methods in the HTML format to page break based on value:
No... You cannot mix languages in the Code Behind if you are using C# or
VBScript
Can I use PDF as a BATCH command?
Maybe... I am looking into using JSCRIPT, this requires some syntax / logic changes from javascript to jscript Yes... You can use WScript.exe BATCH Command from the Code Behind to create a PDF document Yes... Write the html Data to be converted to Disk and use a Response.Redirect("./pdf.asp?command=send%20to%20client&filename=html.data") to an ASP file //--- Add Lines Here to Execute ----- CollinsPDF('write filename=C:/Temp/HelloWorld.pdf',"<B>Hello World</B>"); //=================================================================================== // PDF_Server.js // Author: Clif Collins Date: Feb 2013 //------------------------------------------------------------------------------------- // // Terms of Use Agreement // ...
Creating the content of the PDF document on the client is straight forward, getting the browser to load the contents as a PDF document is
not. The problem is; how to change the MIME type inside the browser from HTML to
PDF? Chrome, Opera, IE9, Safari browsers have this capability, for the other browsers you have
to find a way to open a window with the content of the PDF in memory
I need an example of using Type1 fonts:
window.location.href = CollinsPDF('return as=DataURL','Hello World');
htmlData = '<font face="Gothic.pfb,CP1250">Clif Collins</font>'; CollinsPDF('',htmlData); How do I set a page break?
CollinsPDF('',"Hello<PageBreak>World");
|