Forum Replies Created

Viewing 15 posts - 1,351 through 1,365 (of 4,249 total)
  • Author
    Posts
  • in reply to: .NET and MediumTrust
    #28572

    We’ve just build the new version with the attribute added (excl. the version for Mono platform). The version is currently being tested. Please contact support pd4ml com if you would like to test in on your side.

    Tom
      in reply to: Problem with output ledger type PDF Width
      #28590

      I just replaced with your code . Firstly document is getting generated with a size of 0kb by taking 10 sec to 12 secs time. When i try to open it obviously it is showing file is damaged.

      if you want i can provide you my input html .

      Please suggest the solution for this problem or give a conclusion on this regard. We need to tell the same to our client as soon as possible.

      The following is the code i used

      java.io.FileOutputStream fos = new java.io.FileOutputStream(outputPDFFile); PD4ML pd4ml = new PD4ML();
      pd4ml.fitPageVertically();
      pd4ml.setPageSize(pd4ml.changePageOrientation(PD4Constants.LEDGER)); // ledger page orientation
      double desiredRatio = (double)PD4Constants.LEDGER.width / PD4Constants.LEDGER.height;
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      for ( int i = 0; i < 40; i++ ) { int width = 900 + (i * 20); pd4ml.setHtmlWidth( width ); pd4ml.render("file:" + inputHTMLFileName, baos); int height = ((Long)pd4ml.getLastRenderInfo(PD4Constants.PD4ML_DOCUMENT_HEIGHT_PX)).intValue(); //width = ((Long)pd4ml.getLastRenderInfo(PD4Constants.PD4ML_RIGHT_EDGE_PX)).intValue(); // for special cases double actualRatio = (double)width / height; if ( actualRatio < desiredRatio * 1.1 && actualRatio > desiredRatio * 0.9 ) {
      break;
      }

      baos.reset();
      }

      fos.write( baos.toByteArray() );
      fos.close();

      in reply to: Problem with output ledger type PDF Width
      #28591

      As I wrote it was only schematic code. Put there some debug output and check if the condition is true at some point.

      if ( actualRatio < desiredRatio * 1.1 && actualRatio > desiredRatio * 0.9 ) {
      break;
      }

      The resulting document is 0 bytes, as it is reset by the line:

      baos.reset();

      Probably it makes sense to place the line just after

      for ( int i = 0; i < 40; i++ ) {

      Tom
        in reply to: Problem with output ledger type PDF Width
        #28592

        Well, i had to do lot of trail and error kind of things before i write new comment with my observations on your code.
        Still we are not comfortable with the solution you provided:

        Reason :
        I had kept your modified code and i did some modifications to reduce the time taking by pd4ml to generate the document.

        Your code : ………………..
        for ( int i = 0; i < 40; i++ ) { baos.reset(); int width = 900 + (i * 20); ............. Changed code : .................... for ( int i = 0; i < 3; i++ ) { baos.reset(); int width = 900 + (i * 425); ............. I just reduced the number of iterations. With either your code or my changed code , i could just expand the content to right side. So that left margin, right margin are in sync (i attached the output PDF). The problems i observed are : 1) I could just increase the space between columns. But text font still remain unreadable. How text was appearing before having this new code , same way text is appearing now. You can see in the attached pdf. We have to increase text font here. 2) I thought with the fix of text font ,we resolved the issue . But i just changed the input html to another huge html file comparitively. Problem still persists. Here content is not expanding. I see what ever fix we made is for 1st file. again if i change the numbers it starts expanding. Dont know what i should do with this behaviour of code. In one line , we might needed a code which should 1) expand the content to right , i mean left margins should be in sync 2) text font should be little visible 3)code should behave same for any input file irrespective of content.

        in reply to: Problem with output ledger type PDF Width
        #28593

        The document layout looks like a big table with width=100%, whose cells contain smaller content tables with fixed widths.

        In the case increasing of htmlWidth (it is an analog of browser frame width) just increases gaps between the content tables and has almost no impact to the document height.

        If the nested content tables had width given in percents, at some values of htmlWidth currently multiline content cells could have only a single line of text (which would efficiently reduce the document height and would help to achieve the needed aspect ratio at bigger zoom factors).

        You could just play with the document layout in a web browser – just load the doc and resize the browser frame width. With current layout even if you stretch the frame very wide, the document height will reduce insignificantly. For a better visualization I would recommend to temporarily set border=1 for all tables.

        If you want, for the test you may use PD4ML in GUI mode:
        java -Xmx512m -jar pd4ml.jar

        Tom
          in reply to: Problem with output ledger type PDF Width
          #28594

          I could understand your explanation to some extent. But here the problem is input HTML files come from 3rd party. We dont generate them . Our job is to get the pdf out of that HTML file. What should i do now?.

          in reply to: Problem with output ledger type PDF Width
          #28595

          Well, let’s imagine you need to convert the current discussion thread to a single page PDF. The only chance to put the content “as is” to a single page is to scale it down to almost invisible sizes of fonts. (That is what pd4ml.fitPageVertically() would do). And it is normal – the thread has already too much content for a single page.

          An interactive solution for the “problem” – browser scrollbars. But PDF is paper-output-oriented format. Paper has no scrollbars -> there is no generic solution for the issue – there are content amounts simply do not fit a page.

          So I would recommend to consider multi-page PDF output if it is acceptable by your work requirements.

          If not, you could try to impact the third-party document layout with external CSS style (pd4ml.addStyle()). The goal is to let the content flow horizontally. The solution will work only if the expected input documents has similar structure and their volume only slightly differs from one doc to another.

          Tom
            in reply to: Problem with output ledger type PDF Width
            #28596

            K. I dont think client would accept having multi page pdf output. They need it as Ledger (11/17).

            Also you suggested one solution by adding style to documents with a constraint ,they slightly differ. Actually what ever htmls come, those are reports of their clients. So obviously as there will be huge difference between one report and another report. We cant count on that.

            But as you suggested we shall try to add style while building pdf. So is addStyle method takes care of font and all ?. if not please let me how to use that for my reports.

            in reply to: css @media parsing
            #28339

            We have a similar problem where we have the following in our css

            @media screen and (-webkit-min-device-pixel-ratio:0) { div.gridDefault .ASC, div.gridDefault .DESC{
            display: -webkit-inline-box;
            }
            div.cellIn {
            display: table-cell;
            padding-top: 0px;
            width: 20px;
            }
            }

            But we are getting a org.w3c.css.sac.CSSException: Encountered “and” at line 1, column 34370.
            > Was expecting one of:
            >
            > “{” …
            > “,” …
            >
            > at com.steadystate.css.parser.SACParser.parseStyleSheet(Unknown Source)
            > at org.zefer.html.doc.css.d.Ò00000(Unknown Source)
            > at org.zefer.html.doc.css.c.super(Unknown Source)
            > at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)
            > at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
            > at org.zefer.pd4ml.PD4ML.render(Unknown Source)

            Can you please let me know the solution to this issue?

            in reply to: nullPointerException when rendering page
            #27616

            I believe I have figured out what is causing the nullPointerException. It seems to occur when the users are trying to embed an image which is on their local machine into the page. When I view it on my local server, it just disregards the image. However, on our production server (which is HTTPS:) it crashes. That is the only difference in the servers. Is there anything I can do to work around this?

            Thanks!!

            in reply to: css @media parsing
            #28340

            It is CSS3 syntax, CSS Parser project library (ss_css2.jar) does not support.

            Currently we do some estimations if it can be fixed with moderate efforts.

            in reply to: nullPointerException when rendering page
            #27617

            Which PD4ML version do you currently use? It can be determined from a generated PDF file properties.

            in reply to: HTML/CSS rendering issues
            #26584

            I trying justify my documents, but in right side something its wrong.
            It is possible carefully justify right side of docum (first page)?
            I use 3.7.1b4 ver.

            M.

            in reply to: problem with justify
            #28600

            The document properties tell, that the PDF has been generated with v303b5, so first I would recommend to try the most recent version.

            in reply to: HTML/CSS rendering issues
            #26585

            Hi. I’m working with the Java API for PD4ML, version 3.7.1b4
            When I put a PNG image tag with a file URL in some HTML content:

            <br /> <html><br /> <head></head><br /> <body><br /> <img src="file:///home/jesse/test.png"><br /> </body><br /> </html><br />

            I can render the document as a PDF just fine. The image shows up and all is well.

            When I try rendering the document as an RTF, the image does not show up. No trace of it exists. Not even a box where an image ought to go.

            Also:
            – When I look at the raw RTF code, the pictpngblip tags exist and the data for the image exists.
            – JPEG images are fine in both formats.

          Viewing 15 posts - 1,351 through 1,365 (of 4,249 total)