私が持っているプロジェクトは、Vista Print のようなアプリケーションを作成することです。ドラッグできる領域にサイズ変更可能な div を配置する非常に基本的なインターフェイスを作成しました。designmode でポップアップ iframe を介してこの div にテキストを配置することもできます。次に、これをデータベースに書き込みます。次に、このデータを呼び出し、Coldfusions cfdocument を使用して PDF を作成します。
問題は、PDF が作成されたときにフォントが少し太く見え、単語の折り返しが非常に重要な HTML ページ インターフェイスとは異なることです。注: 単語の折り返しは、div の高さと幅によって決まります。PDFが作成されたときにオフになっているcfdocumentプロセスページでは問題ないように見えます。誰でもこれについてアイデアを持っているか、役立つ情報を教えてもらえますか?
前もって感謝します。
ここにコード:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<cfset webRes = "96">
<cfset pxlWidth = "921">
<cfset pxlHeight = "1178">
<cfset inWidth = (pxlWidth/webres)>
<cfset inHeight = (pxlHeight/webres)>
<cfquery name="qTextData" datasource="ds">
SELECT DocID, TextID, Width, Height, PosX, PosY, FontFamily, FontColor, FontSize, TextValue
FROM TextEditor
WHERE ((DocID = #session.docid#))
</cfquery>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Create PDF</title>
</head>
<cfoutput>
<cfdocument filename="mypdf.pdf" name="mypdf" fontembed="yes" format="pdf" overwrite="yes" pageheight="#inHeight#" pagewidth="#inWidth#" pagetype="custom">
<cfdocumentsection margintop="0" marginright="0" marginbottom="0" marginleft="0">
<body align="center" marginheight="0" marginwidth="0">
<div id="pageContainer" style="background-image:url(resources/image.caspx.jpg); background-repeat:no-repeat; height:#pxlHeight#px; width:#pxlWidth#px;">
<cfloop query="qTextData">
<div id="divTextField_#TextID#" style="position:absolute; top:#PosY#px; left:#PosX#px; width:#width#px; height:#Height#px; color:#FontColor#; font-family:#FontFamily#; font-size:#FontSize#pt; vertical-align:text-top; line-spacing:normal;">
#TextValue#
</div>
</cfloop>
</div>
</body>
</cfdocumentsection>
</cfdocument>
</cfoutput>
<script type="text/javascript">
window.open('http://linktopdf/mypdf.pdf','newWin','resizable=1');
</script>
</html>