472,983 Members | 2,318 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,983 software developers and data experts.

Setting the version of a PDF file using Crystal Reports and/or C#.

I've been looking on the web trying to find a solution to converting a
PDF Form from v.1.6(Acrobat 7) to PDF v1.4(Acrobat 5). It's one of
those weird situations where one of the applications I'm using requires
v.1.4. v.1.6 will mess up the application itself. PDFversion.exe (a
conversion utility) doesn't support the 1.6 format and Acrobat 7
doesn't want to do backwards conversion on a PDF Form (at least from
what I can see).

So... I figure I have 2 options: 1.) recreate the form using Acrobat
5, or 2.)use some of my knowledge of C# and crystal reports to create a
little database and generate form output using the Crystal Reports
engine built into Visual Studio 2005. The form way is probably
quicker... but I like programming, so option 2 sounds like more fun :)

My problem is that the PDFs that I'm creating via C#+Crystal Reports,
are version 1.3 (I can't win, lol). However, I did find some nifty
Java code that allows the version of a PDF to be controlled
programmatically. Does anyone know if theres a command/switch/etc...
that would allow me to define the version of the PDF I'm outputting
when I do:
someRPT.ExportToDisk(CrystalDecisions.Shared.Expor tFormatType.PortableDocFormat,"SomeFile.pdf");

For the Java code I found the following stuff:

// setting a PDF to version 1.3, 1.4, 1.5, or 1.6
import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;

public class PdfVersion1_3 {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("PDFversion1_3.pdf"));
writer.setPdfVersion(PdfWriter.VERSION_1_3);
//writer.setPdfVersion(PdfWriter.VERSION_1_4);
//writer.setPdfVersion(PdfWriter.VERSION_1_5);
//writer.setPdfVersion(PdfWriter.VERSION_1_6);
document.open();
document.add(new Paragraph("This is a PDF-1.3 document"));
} catch (Exception ioe) {
System.err.println(ioe.getMessage());
}
document.close();
}
}


// setting a PDF to version 1.2
import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;

public class PdfVersion1_2 {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("PDFversion1_2.pdf"));
writer.setPdfVersion(PdfWriter.VERSION_1_2);
document.open();
document.add(new Paragraph("This is a PDF-1.2 document"));
} catch (Exception ioe) {
System.err.println(ioe.getMessage());
}
document.close();
}
}

This all leads me to believe that there must be a way. Even if I don't
end up going the programming route, it's still good to know though.

Thanks in advance for any responses.
Wayne

Jan 25 '07 #1
0 1674

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Devesh Aggarwal | last post by:
I developed reports in Crytsal Reports 9.0 in landscape mode. When i print the same from crystal reports it prints perfectly in Landscape even if the printer setting is set to potrait by default. ...
5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
0
by: JDP | last post by:
How do I tell what version of Crystal is being used in VS .Net? Is there a way to tell what version my report was created in? Details: During the installation of VS 2003 we were prompted and...
2
by: Stu | last post by:
Hi there, I am trying to set up a Crystal Report with the following tables: Customer Info: -Name -Address -CustomerID Orders:
1
by: | last post by:
Hi, I am loading some crystal reports in a method similar to this (see below). And set the cursor to waiting while the reoprt is loaded, run and shown. BUT while the report is running the cursor...
5
by: Glen Richards | last post by:
I've had no success in trying to dynamically set images at runtime in a Crystal Reports 9 report using C# 2005 Beta. I've been doing research along these lines & all the posts I've read say this...
3
by: Lucas Tam | last post by:
Hi all, This is sort of an off topic post, but since many of you have used CR I thought I'll ask here. Does anyone know the difference between the bundled version of CR and the "full" version...
4
by: chad.a.morris | last post by:
I'm new to Crystal Reports, so this may be a dumb problem, but I just can't figure it out. Basically, I want to control the selected data in the C# code as opposed to Crystal Reports (since SQL...
1
by: Kannan | last post by:
Hi, I have noticed that Visual studio 2005 coming along with Crystal report. I have few crystal reports which is developed in 6.0 in my existing VB project and currently we are migrating m y VB...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.