SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    From Html to PDF

    Is it possible to have the dynamically created graphic line to get displayed in PDF from htmlpages?

  2. #2
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you trying to turn an HTML web page into a PDF? If so, give TCPDF a try. It's an open-source PHP library that comes with many examples.

  3. #3
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply.

    I did try with that. The problem is that I am not getting the results of the line which I drew dynamically from one box to another in the html page to PDF.

    Thats why I had a doubt and asked whether is there a possibility for the dynamically created graphics line to get displayed in the PDF.

  4. #4
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would try testing it by removing all the other parts of the PDF besides the graphic you referenced. If it still does not show up, you may have to translate your graphics into something that TCPDF can understand. I see on the examples page (http://www.tcpdf.org/examples.php), example #12 shows some graphic transformations. I hope this helps!

  5. #5
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply.

    But I saw the coding for the example you have mentioned. The coding are given with X and Y values for the graphics to get displayed in the PDF. What I have created is the user will draw a line in the webpage. So does that value need to get stored in some variables and that should be used to display the graphics line in the PDF?

  6. #6
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes exactly. If your user is going to draw a line on a web page, you'll need the starting point (X1 and Y1) and the ending point (X2 and Y2). Then you can pass these as parameters to the TCPDF Line function: $pdf->Line(X1, Y1, X2, Y2, $style);

    Depending on the shapes your drawing this may get much more complex. Also, you may have to change the coordinates depending on where you want the graphic to show up in your PDF.

  7. #7
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply.
    I will try it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •