cancel
Showing results for 
Search instead for 
Did you mean: 

Help finding an API that reads the PDF output so that I can break reports.

Former Member
0 Kudos

We have a process where we like to print reports once then break them out do different business entities. I'd like to know what if any API's are available, best if free, to be able to check the text in a page for a tag so that I can break the pages based on this flag and change the text that was at that location. I've been having a hard time finding something that looks like it would work well.

The API needs to support reading a PDF report in a background service(no desktop or GUI access), allow me to search for text at the bottom of a page, then break pages based on information into separate files.

I've seen some that use intra process communication between an Adobe reader but I'd like to avoid this because our process that would do this is running under a background service that has no user interface or user access.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hello Robert

I moved your post to the SAP Crystal Reports, version for Visual Studio forum - assuming you're looking for .NET APIs.

Unfortunately, there is no such API. You can certainly export to PDF, but there are no APIs for breaking a report into some number of parts and exporting those to different PDF files. Only a report based on Selection Formulas would come even remotely close to your requirement.

Typically, if you can not do it in the CR designer, you can not do it at runtime.

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

I don't know that this has much to do with Visual Studio. I'm not using VS to write reports. We're writing to the 2008 .NET api to generate the reports.

I'd be happy for some help finding a third party API that would allow me to do this. I don't want to add someone else's scheduler because we already have our own scheduler and program to print reports. What I need is an API, preferably royalty free, that will allow me to read a page and determine if I need to write it to a different file. This can't require user intervention because it will be running under a service.

former_member183750
Active Contributor
0 Kudos

Sorry - can't help. Don't know of anything even remotely similar to the requirements.

- Ludek

Former Member
0 Kudos

With luck, maybe someone else will know of one.

0 Kudos

Hi Robert,

I moved your post back to the Report Design forum. There are 3rd party app's that can do this but they won't be free, Ido writes them and is in here often. May be something that is not too expensive though....

Another option is to set your report filtering and formatting to do this also, not clear on what you are doing when scheduling or if you wrote it etc. but there is also an option in Business Objects Enterprise that allows you to do Report bursting which you can configure to do the filtering with a separate PDF output.

If you are using BOE then consult the Administrators Guide on how to configure and use. If not then as Ludek indicated, nothing in our SDK to allow you to edit the PDF file, not a CR property. Try the Adobe forums or just google it, maybe another site has something free.

Good luck

Don

Former Member
0 Kudos

I know we could run individual reports using filters but the problem with that is the run time needed to do so. We currently do this with RTF documents in that we print the report once, then we post process the resulting file and break the pages up into separate documents based on a tag in the footer. Thus we run the report once and then can break it up into several reports in a few seconds where running the report multiple times with different filters would take hours and waste CPU cycles that will be needed for applications that do the real work in the system.

We'd like to do something similar with PDF but PDF documents are saved as graphic as apposed to text. So I need an API to read the report and allow me to process a page at a time and check the text at the bottom of each page so that I can then break the report up and possibly replace the tag with the relative page number.

0 Kudos

Sorry, like We've said, CR has no PDF API's but here's another option....

One way to speed it up is the get ALL of the data in one run. Then export to RPT format so it has saved data, and then you can alter a parameter or record selection formula to export to PDF. This way it only runs once, applying filtering on a saved data report has no performance issues at all.

OR using the CR SDK and using the Saved Data Controller in .NET tou can then apply the same filtering against the report with saved data and then export the output by name which you can set. Would be a simple app to write, then your back end process could simply e-mail or however you deliver the PDF to the end users.

This is using CR for VS 2010. I don't have any samples right now on using the Saved data controller but I can create it if you want to go this route, unless you figure it out for yourself.

Here's the code to export to PDF:

CrystalDecisions.ReportAppServer.ReportDefModel.PDFExportFormatOptions RasPDFExpOpts = new PDFExportFormatOptions();

CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions RASexportOpts = new CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions();

rpt.Load(@"C:\Reports\SavedDataReport.rpt");

string MyRptName = rpt.FileName.ToString();

MyRptName = MyRptName.Substring(MyRptName.LastIndexOf(@"\") + 1, (rpt.FileName.Length - 3) - (MyRptName.LastIndexOf(@"\") + 1)) + "pdf";

// line above you can append a number or something unique so you know who it's for

rptClientDoc = rpt.ReportClientDocument;

RasPDFExpOpts.StartPageNumber = 1;
RasPDFExpOpts.EndPageNumber = 2;
RasPDFExpOpts.CreateBookmarksFromGroupTree = true;

rptClientDoc.PrintOutputController.ExportEx(RASexportOpts).Save(@"C:\Reports\" + MyRptName, true);

PageNumber can be commented out to export all pages or you can use the saved data controller to detect your flags, I think, never tried it but I believe it should work, and set the page numbers to export.

Don

Former Member
0 Kudos

I have the exporting to PDF working already. In fact, I've implemented all of the available formats. Seems to work OK.

The issue is just breaking the report.

0 Kudos

So, you are not wanting to "fix" or "Report" the "breaking the report" problem, you just want to know if Adobe has an API set for free where you can work around what ever is broke....

Good luck

Don

Former Member
0 Kudos

If you read the original post, I am not attempting to report a problem with CR. I am asking if anyone knows of an API that would, hopefully, be royalty free that would read a PDF file and allow me to break it. Most of what I've found uses some form of IPC to interact with a GUI reader. Since the process will be running under a background service, it cannot rely on a GUI interface and have no user intervention. We already have our own scheduler and mail system in our product.

I was just hoping that someone here would know of such an API. Most searched I've done on this have just turned up GUI applications and I need to be able to have this all run automatic, in the background processing.

Sorry if this was the wrong place. I was just looking for some help, not reporting a problem.

Answers (0)