473,396 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1714

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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.