Forum Replies Created
-
AuthorPosts
-
in reply to: png images errors while parsing April 12, 2011 at 00:26in reply to: png images errors while parsing April 6, 2011 at 16:53#28471
ok now you can find it attached to the message and by the way its a signature
thank you very much
in reply to: png images errors while parsing April 6, 2011 at 06:47#28469hello
please find the PNG that causes the parsing problem attached to the message . also find html that includes the image below
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Page</title> </head> <body> <table border="0" width="648" id="table1" cellspacing="0" cellpadding="0" style="border-collapse: collapse"> <tr id="controlspacebar"> <td> </td> </tr> <tr id="controlbar"> <td> <span style="cursor: hand;"> <img alt="?????" title="?????" src="/images/ecs/images/icon_print.gif" onclick=" printDoc();" /></span> <span style="cursor: hand;"> <img width="32" height="32" alt="?????" src="/images/ecs/images/headersig.png" onclick=" printPDF(1,0,'264','1','060062069078088094'); " /> </span><span style="cursor: hand;"> <img width="32" height="32" alt="????? ??? ??????" src="/images/ecs/images/noheadersig.png" onclick=" printPDF(0,0,'264','1','060062069078088094'); " /> </span><span style="cursor: hand;"> <img width="32" height="32" alt="????? ????" src="/images/ecs/images/headernosig.png" onclick=" printPDF(1,1,'264','1','060062069078088094');" /> </span><span style="cursor: hand;"> <img width="32" height="32" alt="????? ???? ??? ??????" src="/images/ecs/images/noheadernosig.png" onclick="printPDF(0,1,'264','1','060062069078088094'); " /> </span><span style="cursor: hand;"> <img width="32" height="32" alt="????? ??? ??????" src="/images/ecs/images/signature.gif" onclick=" hideHeader(); printDoc(); showHeader(); " /> </span><span style="cursor: hand;"> <img width="32" height="32" alt="????? ????" src="/images/ecs/images/signature.gif" onclick=" hideSign(); printDoc(); displaySign(); " /> </span><span style="cursor: hand;"> <img width="32" height="32" alt="????? ???? ??? ??????" src="/images/ecs/images/signature.gif" onclick=" hideSign(); hideHeader(); printDoc(); displaySign(); showHeader(); " /> </span><span style="cursor: hand;"> <img id="inboxnote" width="32" height="32" alt="???????" src="/images/ecs/images/Chat_01.gif" onclick=" hideall(); showhide(this,'sendlayer'); var url='http://aghqsrv97.auh.police:80/ecs/ECS_016.viewnotes?p_lang=&P_DOCUMENTNUMBER=264&P_TRANSACTION_NUMBER='; ajaxRef('sendlayertxt',url);"> </span><span> <input type="hidden" id="menu3" /></span> </td> </tr> <tr> <td height="5" align="center" id="navigationbar"> </td> </tr> <tr> <td height="5" align="center" id="messagebar"> </td> </tr> <tr> <td height="5" align="center" id="docheader"> <table border="0" width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="270"> <table border="0" id="table4" style="border-collapse: collapse"> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 19">???? ???????? ??????? ???????</span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 19">????? ????????</span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 19">??????? ?????? ????? ??????</br></span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 16">????????? ????????? ??????????? ????????????</span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 16">???????? ????????? ??????</span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 16"></span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 16"></span> </td> </tr> </table> </td> <td width="110" align="center"> <img alt="Image from the forum topic: png images errors while parsing" src="/images/ecs/images/adplogo_s.gif"> </td> <td width="270" align="left"> <table border="0" id="table5" style="border-collapse: collapse"> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 18">United Arab Emirates</span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 18">Ministry of Interior</span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 18">Abu Dhabi Police G.H.Q</br></span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 14">Human Resources General Directorate</span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 14">G. Director Office</span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 14"></span> </td> </tr> <tr> <td align="center"> <span style="font-family: Arial; font-weight: bold; font-size: 14"></span> </td> </tr> </table> </td> </tr> </table> <table border="0" width="100%" cellpadding="0" cellspacing="0"> <tr valign="top" height="1" cellpadding="0" cellspacing="0"> <td width="100%" valign="top" height="1"> <hr color="#000000"> </td> </tr> </table> </td> </tr> <tr> <td height="5" align="center" id="docbody"> <table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse" align="center"> <tr> <td colspan="3"> <table width="100%" border="0" cellpadding="2" cellspacing="0"> <tr style="font-family: Arial"> <td width="40%"> <table border="0"> <tr> <td> ???????? </td> <td> : </td> <td> 11/2/33 </td> </tr> <tr style="font-family: Arial"> <td> ????????? </td> <td> : </td> <td> 15/10/2007 ? </td> </tr> <tr style="font-family: Arial"> <td> ????????? </td> <td> : </td> <td> 03/???? /1428 ?? </td> </tr> </table> </td> <td width="20%"> </td> <td width="40%" valign="top" align="left"> </td> </tr> <tr> <td width="100%" style align="center" colspan="3"> <br> <table width="100%" border="0" cellpadding="2" cellspacing="0"> <tr style="font-family: Arial; font-size: 16pt"> <td title="4003 - ???? ?????? ????? ??????? ???????"> <b> ???? ?????? ????? ??????? ???????</b> </td> </tr> </table> </td> </tr> <tr align="left"> <td colspan="3"> <table> <tr> <td style="font-family: Arial"> <b>??????? : </b> </td> <td style="font-family: Arial" lang="ar-ae"> <b><u>???? ????????</b> </td> </tr> </table> </td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"> <span style="font-family: Arial">?? ???? ?? </span> </td> </tr> <tr> <td colspan="2"> </td> <td valign="top" align="left"> <table border="0" align="left"> <tr> <td valign="bottom" width="auto"> <span style="font-family: Arial; font-size: 16pt"><b>??????/</b></span> </td> <td width="180"> <div id="sign2641"> <span style="font-family: Arial"> <img alt="Image from the forum topic: png images errors while parsing" border="0" height="80" width="180" src="ecs_100.download?p_file=f2514/test.png"></span> </div> </td> </tr> <tr> <td colspan="2"> <span style="font-family: Arial; font-size: 16pt"><b>????????? ???? ??????????????</b></span> </td> </tr> <tr> <td colspan="2"> <span style="font-family: Arial; font-size: 16pt"><b></b></span> </td> </tr> </table> </td> </tr> <tr> <td colspan="3"> <span style="font-family: Arial; font-size: 10pt"><u>???? ??? :</u></span> </td> </tr> <tr> <td colspan="3"> <span style="font-family: Arial; font-size: 10pt"> <p align="RIGHT"> <li>asdfasdf</li> </span> </td> </tr> <tr title="???? ??????"> <td colspan="3"> <span style="font-family: Arial; font-size: 10pt"> <p align="RIGHT"> <li>500254 - 10/10/2007</li> </span> </td> </tr> </td> </tr> </table> </td> </tr> </table> </body> </html>thanks
in reply to: png images errors while parsing April 5, 2011 at 22:20in reply to: Error while rendering PDF March 23, 2011 at 14:28#28486hello
here is an example servlet that uses the class directly beneath it to do the conversion job
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ae.rwd.servlet; import ae.rwd.model.Pdf; import java.io.ByteArrayOutputStream; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author Anas */ public class PdfCreater extends HttpServlet { private static final String bodyUrlParamater = "bodyUrl"; private static final String headerUrlParamater = "headerUrl"; private static final String footerUrlParamater = "footerUrl"; private static final String charsetParamater = "charset"; private static final String contentType = "application/pdf"; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletOutputStream out = response.getOutputStream(); String bodyUrl = null; String headerUrl = null; String footerUrl = null; String charset = null; bodyUrl = request.getParameter(PdfCreater.bodyUrlParamater); if (bodyUrl == null || bodyUrl.length() == 0) { throw new ServletException(); } headerUrl = request.getParameter(PdfCreater.headerUrlParamater); footerUrl = request.getParameter(PdfCreater.footerUrlParamater); charset = request.getParameter(PdfCreater.charsetParamater); ByteArrayOutputStream baos = Pdf.convertHtmlToPdf(bodyUrl, headerUrl, footerUrl, charset); response.setContentType(PdfCreater.contentType); response.setContentLength(baos.size()); out = response.getOutputStream(); baos.writeTo(out); out.flush(); out.close(); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } @Override public String getServletInfo() { return "Short description"; } } /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ae.rwd.model; import java.awt.Dimension; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; import org.zefer.pd4ml.PD4Constants; import org.zefer.pd4ml.PD4ML; import org.zefer.pd4ml.PD4PageMark; /** * * @author Anas */ public class Pdf { protected static int userSpaceWidth = 638; protected static Dimension format = PD4Constants.A4; protected static boolean landscapeValue = false; protected static int topValue = 10; protected static int leftValue = 50; protected static int rightValue = 50; protected static int bottomValue = 10; public static ByteArrayOutputStream convertHtmlToPdf(String bodyUrl, String headerUrl, String footerUrl, String charsetParam) throws MalformedURLException, FileNotFoundException, IOException { java.io.ByteArrayOutputStream fos = null; PD4ML pd4ml = null; PD4PageMark header = null; PD4PageMark footer = null; String charset = "windows-1256"; URL url = new URL(bodyUrl); fos = new java.io.ByteArrayOutputStream(); pd4ml = new PD4ML(); if (charsetParam != null && charsetParam.trim().length() > 0 && charsetParam.equalsIgnoreCase("UTF-8")) { charset = "UTF-8"; } if (headerUrl != null) { header = new PD4PageMark(); header.setHtmlTemplate(getUrlAsStream(headerUrl, charset)); header.setAreaHeight(-1); pd4ml.setPageHeader(header); } if (footerUrl != null) { footer = new PD4PageMark(); footer.setHtmlTemplate(getUrlAsStream(footerUrl, charset)); footer.setAreaHeight(-1); pd4ml.setPageFooter(footer); } pd4ml.useTTF("java:fonts", true); //pd4ml.useTTF("/windows/fonts", true); //pd4ml.setDefaultTTFs("Times New Roman", "Arial", "Courier New"); //pd4ml.setDefaultTTFs("Simplified Arabic", "ae_Arab", "ae_Nice"); pd4ml.setPermissions("empty", PD4ML.AllowCopy, false); pd4ml.setPermissions("empty", PD4ML.AllowModify, false); pd4ml.setPermissions("empty", PD4ML.AllowPrint, true); // pd4ml.setPageInsets(new Insets(topValue, leftValue, bottomValue, rightValue)); pd4ml.setHtmlWidth(userSpaceWidth); pd4ml.setPageSize(format); pd4ml.enableDebugInfo(); pd4ml.adjustHtmlWidth(); pd4ml.render(url, fos); return fos; } private static String getUrlAsStream(String Url, String charset) throws MalformedURLException, IOException { URL url = new URL(Url); return convertInputStreamToString(url.openConnection().getInputStream(), charset); } private static String convertInputStreamToString(InputStream is, String charset) throws IOException, UnsupportedEncodingException { if (is != null) { Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reader = new BufferedReader(new InputStreamReader(is, charset)); int n; while ((n = reader.read(buffer)) != -1) { writer.write(buffer, 0, n); } } finally { is.close(); } return writer.toString(); } else { return ""; } } }i hope this good for you
thanks
in reply to: Error while rendering PDF March 22, 2011 at 19:50#28483hello
yes the cause is an image with extention PNG .. but why its not accepting PNG images
thanks
in reply to: fonts included in the html March 21, 2011 at 20:00#28466thank you
so if i do as you say any html tag that contains a font attribute with specific font will be interrepted with the appropriate font that i have just embadded and no need to add any additional code i just need say
pd4ml.usttf("windows:fonts",true);thank you
in reply to: dir=rtl is not working March 17, 2011 at 14:44#28460thank you
so you mean i will get an evaluation release in about one week that supports dir=”rtl” and specially column reordering which i can evaluate before i buy the library .
if nothing more than one week from now then i will wait . please confirm
thank you
in reply to: dir=rtl is not working March 17, 2011 at 14:11#28458ok thank you . but please update me on when its gonna be implemented to change the direction for columns so that i can decide weather i should look for options other than PD4ML or wait for PD4ML
thank you
in reply to: dir=rtl is not working March 17, 2011 at 13:23#28456thank you for your reply
but i think you should remove it from the list of supported Html list cause its not fully supported and that is misleading just as what happened with me . also i will wait for your reply and i hope you have good newsthank you very much
in reply to: dir=rtl is not working March 17, 2011 at 09:35#28454why the support is very slow
in reply to: PD4ML multicolumn functionality does not support Arabic RTL March 17, 2011 at 05:13#28096hello
have this been solved ???? please tell me cause i am facing the same issuein reply to: dir=rtl is not working March 16, 2011 at 20:45#28453thanks for your reply
i am using TTF embadding and the main problem is that the table columns are never reordered correctly when i set dir to rtl .
any way can you please answer the below1) is there a way i can change the direction programitacally Using PD4ML API
2) when are you going to fully support this . i need languages other English and i am worried that you dont support such attributes like dir=rtl . it should change the order of the columns
3) also why you dont have roadmap plans . so that we know when you are going implement .
I really need a workaround please if i want to buy this library. i will buy it directly if i get this fixed because
please let me get a quick answer
thanksin reply to: dir=rtl is not working March 16, 2011 at 14:31#28451hey guys ….your support is very slow . please help me here cause i wanna buy the tool directly if this works
plese plese plese
thanksin reply to: Pro evalution Bug as it seems March 5, 2011 at 16:16#28445hey there no answers for me herer … please help me solving my problem
-
AuthorPosts
