CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Create Web reports in PDF format and convert documents to PDF

Print topic Send  topic

Author Message
peterr


Posts: 5971
Posted: 02/13/2006, 1:32 PM

Hi all,

We are about to release a new product called SuperPDF, which allows conversion of HTML output to PDF and works with the "Convert Page to PDF" action in CCS. This product works only on Windows computers and is installed as a PDF printer driver, thus it can also be used on desktops to convert any type of documents to PDF. The pre-release version can be downloaded from http://www.yessoftware.com/download/files/superpdf/SuperPDF_10.exe

There is also an updated version of the "Convert Page to PDF" action at http://www.yessoftware.com/download/files/superpdf/CCSA...rtPagetoPDF.zip
After downloading please unzip it to the following (or corresponding) folder: C:\Program Files\CodeChargeStudio3\Components\Actions\Server\General

The action should be placed in the "Before Output" event of any page, whether it's a report or other. Sample action properties are as follows:
Command: C:\Program Files\SuperPDF\bin\pdftool.exe
Options: {InputFile} -f {ResultFile} -root {Root}
Temporary Folder: %TEMP

In case of problems please try changing the "Temporary Folder" property to a specific folder, like "C:\foldername". Additional information is provided in the included Help file.

SuperPDF also requires another component called GhostScript converter and related instructions are provided within the Help file, plus you may be prompted to download it during or after installation.

The product will be priced at $49.95 per computer installation (whether a desktop for company/personal use or Web server for Web output), or at $29.95 for 10 or more licenses. Each desktop or Web server requires a separate license.

The main advantage of this product over similar solutions is its low price and command-line interface for programmatic control. We found many similar solutions that are very inexpensive for desktop use but cost $250-$2000 for use with Web applications. Other solutions don't provide programmatic control, or not in the way that we'd like. SuperPDF also supports multi-threading for use in multi-user environments, although print jobs may be slowed down by the Windows Print Spooler.

We're still testing this product and making minor improvements. Please let us know if you find any problems or have suggestions. We hope that you will enjoy it.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Chris Herbert
Posted: 02/13/2006, 1:56 PM

This is great, I'll give it a try. Is it possible to use this to automatically generate a report and attach to an outgoing email without displaying to the screen?
peterr


Posts: 5971
Posted: 02/13/2006, 3:08 PM

Chris,
It's a good question. I'm sure it's possible and I'll just need to find out how. Could you please specify your programming language that you are using. I may need to get some sample code and it can be faster to do this for just one programming lanague for now.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Saud

Posts: 15
Posted: 02/13/2006, 8:07 PM

To say it simply : ""!

A great component and addon for a great product. I tried it in English and Arabic (Unicode) and it worked perfectly.

A quick observation on the command line version:

- No bottom margin preference. A page will be printed until it reaches the end of the document which is not identical with the top margine.

Regards,

Saud
View profile  Send private message
Saud

Posts: 15
Posted: 02/13/2006, 8:08 PM

To say it simply : "THANK YOU"!

I dunno why it was omitted from the previous reply!
View profile  Send private message
mrachow


Posts: 509
Posted: 02/14/2006, 1:02 AM

Hi Peter,
just "printed" on letter sized page.
SuperPDF uses right locale (date format, page in corresponding languge).

But when using A4 page format the first lines including header where cut.
(Just curious because A4 is higher than letter :-) )
_________________
Best regards,
Michael
View profile  Send private message
peterr


Posts: 5971
Posted: 02/14/2006, 1:20 AM

Hmm, both A4 and letter worked OK for me when printing to PDF from the desktop. A4 output only had little more empty space on the page. Are you printing from your desktop or a Web application?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
thierry Korsec
Posted: 02/14/2006, 7:38 AM

the same would be nice with excel and word


--------------------
Regards
Thierry
Walter Kempees
Posted: 02/14/2006, 7:51 AM

But first a Linux variant for all those Linux/Apache/Php dev'ers.

<thierryKorsec@forum.codecharge (thierry Korsec)> schreef in bericht
news:243f1f97baeea0@news.codecharge.com...
> the same would be nice with excel and word
>
>
> --------------------
> Regards
> Thierry
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

bedollandres

Posts: 48
Posted: 02/14/2006, 8:22 AM

I'm getting a blank pdf... what may I be doing wrong?
_________________
bedollandres
View profile  Send private message
peterr


Posts: 5971
Posted: 02/14/2006, 9:12 AM

Thierry,
Excel and Word were always supported in all Web applications by standard HTML functionality. It's easy to do, lots of related articles on the Internet, and there is an Excel output example in CCS Example Pack.

bedollandres,
This may require a closer look. I recommend contacting the support and they can investigate this issue.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
mrachow


Posts: 509
Posted: 02/14/2006, 9:22 AM

Hi Peter,
Quote :
Hmm, both A4 and letter worked OK for me when printing to PDF from the desktop. A4 output only had little more empty space on the page. Are you printing from your desktop or a Web application?
I tried all on my dectop PC.
I tried it from Word now.
Same thing. It seems as if the portion A4 is larger than letter is cut not added to the page.
My first try was printing simple text from my editor (MultiEdit).
I have no idea at the moment.
_________________
Best regards,
Michael
View profile  Send private message
peterr


Posts: 5971
Posted: 02/14/2006, 12:24 PM

Michael,

This could be true, depending on your page setup settings in IE or MS Word. For example if you had a physical printer that can print only Letter size then selecting A4 size during printing would result in the same effect that you've seen.
Thus first make sure that your printer page size matches the page size that you are selecting later in SuperPDF dialog. For example in IE select File -> Page Setup -> Size -> A4. Then during printing select the same size in SuperPDF dialog.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
mrachow


Posts: 509
Posted: 02/15/2006, 12:19 AM

Hi Peter,

I had checked all settings again now. They should be the same on all places.
One thing I found for now is ...
When you open the generated PDF and look into document properties the pages size is always that of letter.
But the generator had tried to put the amount of A4 on it.
_________________
Best regards,
Michael
View profile  Send private message
Benjamin Krajmalnik
Posted: 02/15/2006, 1:17 PM

Peter,

Thanks for such a great offering - at a realy killer price.
I have already written a utility which converts any document to PDF. The
only thing I was missing was how to tie it all together. Your action code
has enabled me to do so.
All I need to do now is modify my utility to use the same switches and give
it the same executable name, and voila!

Walter Kempees
Posted: 02/15/2006, 1:39 PM

Benjamin
If that is a version that will result in a Linux/Apache/Php solution than I
am more than willing to match the same price !

Walter
Chris Herbert
Posted: 02/15/2006, 2:34 PM

Hi Peter, sorry my reply is late.

Could the email example be in PHP please?

Thank you.
Benjamin Krajmalnik
Posted: 02/15/2006, 3:26 PM

Well, it is using PDF Tools SDK from tracker.
I still have one minor hurdle - the printer selectio dialog is still
cropping up, but hopefully that will be resolved shortly.
That being said, there are some solutions for the Linux world which I have
already found.

It would probably require writing a php "printing script" which would be
executed by the action.
I can email you all of the stuff which I have, or you can download the
latest from sourcefrge.

From the various solutions, the one I think will suit our needs best is
dompdf. It can use either PDFLib (which costs $$$$) or Wayn Munro's fre PDF
class. There is another one, which also uses Wayme Munro's PDF class called
xhtml2pdf.

The way I would approach this would be to create a singe procedure which is
a wrapper utilizing either of these classes. That way you can call it using
the exact same methodolgy used by Yes in their plugin.

All of my dev is going on Windows boxes, so I have not tried this solution.
My current urgent requirement is for the ASP programs, so I started
devloping the windows based solutuion. My next project (we are already
implementing it but nowhere near the point where this will come into play)
is in PHP. Right now I have my assistant doing the legwork. Once I finish
the updates to our commercial products (hopefully by the end of March), I
will be working full time on that, so I may have a pure PHP solution by
then. If I succeed, I will be more than happy to give it to you (or anyone
else) for free.

peterr


Posts: 5971
Posted: 02/15/2006, 4:10 PM

Chris,
Below is sample code for this. The PDF file will be saved on the server and its URL included in an email. Not sure how to attach actual files but there are many resources on the Internet and in PHP documentation where you may be able to find code samples.

  
#Command and options to execute pdftool  
$Command = '"' . "C:\\Program Files\\SuperPDF\\bin\\pdftool.exe" . '"';  
$Options = "{InputFile} -f {ResultFile} -root {Root}";  
  
#Temp folder. Using default temporary folder, or change to your own  
$TempFolder = isset($_ENV["TEMP"]) ? $_ENV["TEMP"] : getenv("TEMP");  
  
#Output Folder on the Web server. Include two backslashes at end.  
$OutputFolder = "c:\\inetpub\wwwroot\\PHP_PDFMail\Mail\\";  
  
#Web URL corresponding to the OutputFolder. Include single slash at and.  
$WebURL = "http://localhost/PHP_PDFMail/Mail/";  
  
#Email Subject  
$MailSubject = "PDF link";  
  
#Email Body  
$MailBody = "Your PDF file is available for download at <a href='{WebURL}'>this</a>.";  
  
#Mail From.  
$MailFrom = "youremailaddress@domain.com";  
  
#Mail content-type  
$MailContentType = "text/html";      
  
$email = CCGetFromGet("mail");  
if (preg_match("/^[\\w\\.-]{1,}\\@([\\da-zA-Z-]{1,}\\.){1,}[\\da-zA-Z-]+$/", $email)) {  
    global $main_block;  
    if (CCSubStr($TempFolder, -1) != DIRECTORY_SEPARATOR && CCSubStr($TempFolder, -1) != "/" && CCSubStr($TempFolder, -1) != "\\") $TempFolder .= DIRECTORY_SEPARATOR;  
    $TempFileName = $TempFolder . "pdf" . session_id() . mt_rand(100000, 999999) . ".html";  
    $ResultFileName = "pdf" . session_id() . mt_rand(100000, 999999) . ".pdf";  
    $WebURL .= $ResultFileName;  
    $ResultFileName = $OutputFolder . $ResultFileName;  
    $WindowsQuote = DIRECTORY_SEPARATOR == "\\" ? '"' : "";  
    if ($TempFileName && $TmpFH = @fopen($TempFileName, "wb")) {  
        fwrite($TmpFH, $main_block);  
        fclose($TmpFH);  
        $Options = str_replace("{InputFile}", escapeshellarg($TempFileName), $Options);  
        $Options = str_replace("{Root}", escapeshellarg(getcwd()), $Options);  
        $Options = str_replace("{ResultFile}", escapeshellarg($ResultFileName), $Options);  
        exec($WindowsQuote . $Command . " " . $Options . $WindowsQuote);  
        if (file_exists($ResultFileName)) {  
            $MailSubject = str_replace("{WebURL}", $WebURL, $MailSubject);  
            $MailBody = str_replace("{WebURL}", $WebURL, $MailBody);  
            $MailHeaders = "From: $MailFrom\nReply-To: $MailFrom\nContent-type: $MailContentType";  
            if (@mail($email, $MailSubject, $MailBody, $MailHeaders)) {  
              $main_block = "<html><body>Email was sent</body></html>";  
            } else {  
              $main_block = "Error: Cannot send email";  
            }  
        } else {  
          $main_block = "Error: PDF file was not created";  
        }  
        unlink($TempFileName);  
    } else {  
      $main_block = "Error: Cannot create temporary file";  
    }  
}  

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Benjamin Krajmalnik
Posted: 02/15/2006, 6:46 PM

http://us3.php.net/function.mail

If you look at the comments are in the page, you will find a class called
class multipartmail
It has everything you need to mail the pdf as an attachment.

Benjamin Krajmalnik
Posted: 02/15/2006, 6:49 PM

Better yet:

http://phpmailer.sourceforge.net/

Walter Kempees
Posted: 02/16/2006, 2:14 AM

Reciprocity is the name of the game.
I'll be more than interested, meanwhile we are also looking in to this, so I
extend the same curtesy.
Thanks B
Jimmy
Posted: 02/16/2006, 3:43 PM

I install the SuperPDF program, the GhostScript and add Convert Page to PDF.xml to C:\Program Files\CodeChargeStudio3\Components\Actions\Server\General.

Under DOS I type: "C:\Program Files\SuperPDF\bin\pdftool.exe" "http://www.yahoo.com" -f "c:\yahoo.pdf"

it work and c:\yahoo.pdf is created as expected.

Now, back to codecharge 3.0.1.5
Command: C:\Program Files\SuperPDF\bin\pdftool.exe
Options: "http://www.yahoo.com" -f "c:\temp\yahoo.pdf"
Temporary Folder: c:\temp

I keep runing the page and nothing is happening. What did I do wrong? is the root required? if so, what should I put?

Please help.
Jimmy

peterr


Posts: 5971
Posted: 02/16/2006, 3:55 PM

This could be a permissions problem. Please check the Troubleshooting section in Help.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 02/16/2006, 4:04 PM

Below is a simplified code example of sending emails with PDF URL, just to understand the basics. There is no email validation or unique filenames, etc.

  
global $main_block;  
  
$email = "test@test.com";  
$TmpFH = fopen("c:\\temp\\page.html", "wb");  
fwrite($TmpFH, $main_block);  
fclose($TmpFH);  
exec('""C:\\Program Files\\SuperPDF\\bin\\pdftool.exe" "c:\\temp\\page.html"  -f "c:\\inetpub\\wwwroot\\NewProject1\\out.pdf" -r "c:\\inetpub\\NewProject1""');   
$body = "Your PDF file is available at\n" .  
  "http://localhost/NewProject1/out.pdf";  
mail($email, "PDF URL", $body, "From:me@here.com");

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Jimmy
Posted: 02/17/2006, 12:32 PM

Thanks for your help. I try to the Troubleshooting section in Help but still can't make it work. But I do able to use the exec command

exec('""C:\\Program Files\\SuperPDF\\bin\\pdftool.exe" "http://localhost/mypage.php" -f "c:\\test\\Mypage.pdf""');

It work. But the only problem is it take too long to run. That mean I may not able use it in my program.

Can you show me how to save php page output (web report) on the server in html format. I look at the pervious post of http://forums.codecharge.com/posts.php?post_id=25411
and http://forums.codecharge.com/posts.php?post_id=43588 but I still not able to understand it. I can't find PParse any where in my page.

Please help. Thanks
zolw


Posts: 51
Posted: 02/23/2006, 8:18 AM

Hi Peter,

Any sample of this PDF printing in ASP.

Thanks,
_________________
Zolw
http://www.xlso.com
View profile  Send private message
peterr


Posts: 5971
Posted: 02/27/2006, 1:34 AM

zolw,

The "Convert Page to PDF" action should work, while unfortunately I don't have a simplified code at this time.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/03/2006, 2:18 AM

Hello,

Please note that SuperPDF download was updated today at:
http://www.yessoftware.com/download/files/superpdf/SuperPDF_10.exe

Couple minor issues and instabilities were fixed, mostly related to displaying blank pages on certain systems. However, we're not sure if all such problems were resolved and we would appreciate bug reports submitted to our support system.
The trial period was also reset back to 20 days.

Thank you.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Christian
Posted: 03/08/2006, 7:38 AM

Hello peterr,

thank you for the new SuperPDF-Component.
I am CCS 2.3 User and like to register SuperPDF.
Ypu posted on: 02/13/2006, 1:32 PM
...
One free license will be available to each CodeCharge Studio user.
...
how to register ... my CCS license is not working

Thanks
 Page 1 of 2  Next Last


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.