Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Jpeg to PDF conversion
Started by Rumana at 08-16-2007 8:09. Topic has 13 replies.

Print Search « Previous Thread Next Thread »
  08-16-2007, 8:09
Rumana is not online. Last active: 8/10/2007 12:38:05 PM Rumana

Not Ranked
Joined on 08-10-2007
Posts 3
Jpeg to PDF conversion
Reply Quote
Our company already purchased the LeadTools Raster Imaging pro. Now our new requirement is we have to convert the jpeg,bmp ...images to PDF as well as Postscript format. Can we use the same Raster imaging pro for that conversion? If so,how? otherwise what product we have to purchase?
please give us the required information.
   Report 
  08-17-2007, 12:40
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,806
Re: Jpeg to PDF conversion
Reply Quote
Yes, all you will need to do is load the source image and then save it out as a PDF or Postscript file.  You will need the PDF Write plugin in addition to Raster Imaging Pro.  For information on pricing and licensing, please contact sales@leadtools.com.

Greg Ross
LEADTOOLS Technical Support
   Report 
  08-20-2007, 7:27
Rumana is not online. Last active: 8/10/2007 12:38:05 PM Rumana

Not Ranked
Joined on 08-10-2007
Posts 3
Re: Jpeg to PDF conversion
Reply Quote
Can i have a sample code or reference to load the image and save it in PDF as well as Postscript?
The PostScript is very important.
   Report 
  08-21-2007, 15:26
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,806
Re: Jpeg to PDF conversion
Reply Quote
I believe I've been in contact with you via email as well.  In the future, please only talk about the same issue via one medium to prevent confusion and possibly having multiple agents working on the same issue.  If it wasn't you, just ignore this and consider it a coincidence.

Here's a snippet of how to load a JPG and save a PDF in C# with our .NET interface.


RasterCodecs codecs;
RasterImage img;
RasterCodecs.Startup();

RasterSupport.Unlock(RasterSupportType.PdfSave, "UNLOCK KEY GOES HERE");

codecs = new RasterCodecs();

img = codecs.Load(@"C:\Program Files\LEAD Technologies, Inc\LEADTOOLS 15\Images\Master.JPG");

codecs.Save(img, Application.StartupPath + "\\..\\..\\out.pdf", RasterImageFormat.RasPdf, 24);

RasterCodecs.Shutdown();


As for Postscript, I misread our documentation when I first answered you.  You cannot save Postscript files, only load them.  And for EPS files, you can load but only save 8bpp grayscale.

If you do not have the unlock key and wish to use try out this functionality, you will need to use the nag version of Leadtools.dll, otherwise you will get the error saying that PDF capability is required.

Greg Ross
LEADTOOLS Technical Support
   Report 
  10-17-2007, 14:18
gatorjoe is not online. Last active: 12/19/2007 6:43:45 PM gatorjoe

Not Ranked
Joined on 09-17-2007
Posts 6
Re: Jpeg to PDF conversion
Reply Quote

Greg,

I tried your sample code above and got the "Feature not supported" error message. My company bought the licenses, so we have the keys to both PDFRead and PDFSave.  I am going from TIF to PDF. I my code I have also included a reference to Leadtools.Codecs.Pdf.dll.

What am I missing ?

Do I have to run the UNLOCK code everytime I do a save or a read ?

Thanks

Joe


   Report 
  10-17-2007, 15:03
BoydP is not online. Last active: 1/18/2008 7:04:31 PM BoydP



Top 25 Posts
Joined on 08-22-2007
Posts 230
Re: Jpeg to PDF conversion
Reply Quote
Did you include Leadtools.Codecs.Tif.dll for loading the tif file?  Make sure you refer to the "Files to be included with your application" section in the help file to make sure you have referenced everything.


Boyd Perkins
LEADTOOLS Technical Support
   Report 
  10-17-2007, 15:14
gatorjoe is not online. Last active: 12/19/2007 6:43:45 PM gatorjoe

Not Ranked
Joined on 09-17-2007
Posts 6
Re: Jpeg to PDF conversion
Reply Quote

Here are all that I reference :

Leadtools, Leadtools.Codecs, Loadtools.Codecs.Pdf, ...Tif, ...Fax, ...Rtf.

The load statement executes fine. It fails on the save.

Thanks

Joe


   Report 
  10-17-2007, 16:08
BoydP is not online. Last active: 1/18/2008 7:04:31 PM BoydP



Top 25 Posts
Joined on 08-22-2007
Posts 230
Re: Jpeg to PDF conversion
Reply Quote
I copied and pasted that code exactly, except added my pdf write key and changed it to load a tif file, and it works completely fine.  I referenced Leadtools.dll, Leadtools.Codecs.dll, Leadtools.Pdf.dll, and Leadtools.Tif.dll.  Could you show me the code you are running or maybe just upload your project that will not work?  If you are going to upload make sure to remove the unlock key.


Boyd Perkins
LEADTOOLS Technical Support
   Report 
  02-29-2008, 14:16
SureshMittapalli is not online. Last active: 2/29/2008 4:43:32 PM SureshMittapalli

Top 100 Posts
Joined on 02-29-2008
Posts 22
Re: Jpeg to PDF conversion
Reply Quote

Hi I used exactly same Code, but it is working ofr jpeg files. Some error "Invalid file format" is occuring when trying to load jpeg. But the code works for tiff files.

 

Can you tell me how we can convert jpeg to pdf?

 

Thanks,

Suresh

 

 


   Report 
  03-02-2008, 11:34
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,361
Re: Jpeg to PDF conversion
Reply Quote
Suresh,

If you are using LEADTOOLS >NET, please add reference to   Leadtools.Codecs.Cmp.dll. If you are using other LEADTOOLS programming interfaces, please make sure to include the lfcmp???.DLL, such as lfCmp15u.dll, in the application path.


Adnan Ismail
LEADTOOLS Technical Support

   Report 
  03-03-2008, 10:29
SureshMittapalli is not online. Last active: 2/29/2008 4:43:32 PM SureshMittapalli

Top 100 Posts
Joined on 02-29-2008
Posts 22
Re: Jpeg to PDF conversion
Reply Quote

This helped, Thanks a lot.

I have one more question, When I load a image from cphysical location like "

img = codecs.Load("c;\\test.jpg); //load input file

But when I tried to load image from stream its throwing error. Can you help me.?

 

Thanks in advance.


   Report 
  03-04-2008, 7:58
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,361
Re: Jpeg to PDF conversion
Reply Quote
Can you give me more details about how exactly you are loading the images from a stream? Also, can you give me more details about the error you get when you try to load your images from stream?
Adnan Ismail
LEADTOOLS Technical Support

   Report 
  03-04-2008, 13:57
SureshMittapalli is not online. Last active: 2/29/2008 4:43:32 PM SureshMittapalli

Top 100 Posts
Joined on 02-29-2008
Posts 22
Re: Jpeg to PDF conversion
Reply Quote

I am coverting tiff to jpeg as below and trying to load codecs.load method.

             FileStream fsInput = null;
            System.Drawing.Image img = null;
            MemoryStream outputStream = null;
            FrameDimension imageDimention = null;


            try
            {
                fsInput = new FileStream(filepath, FileMode.Open, FileAccess.Read);
                img = System.Drawing.Image.FromStream(fsInput);

                outputStream = new MemoryStream();
                 img.Save(outputStream,ImageFormat.Jpeg);

                RasterCodecs.Startup();                
                RasterImageFormat imgFormat = GetRasFormatType(inputFile);

                codecs = new RasterCodecs();

                RasterSupport.Unlock(RasterSupportType.PdfSave, pdfSaveKey); //unlock PDF_SAVE

                img = codecs.Load(outputStream); //load input file


   Report 
  03-05-2008, 12:25
Adnan Ismail is not online. Last active: 1/6/2009 4:12:02 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,361
Re: Jpeg to PDF conversion
Reply Quote
I am still not aware of the cause of your issue and what is the error you are getting exactly. Can you try to isolate the problem and put your code in a small working project (not your full application) and send it to me in a ZIP or RAR file and I will check it for you?
Adnan Ismail
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » Developer » PDF » Jpeg to PDF conversion

Powered by Community Server, by Telligent Systems