Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, January 31, 2007 11:20:48 PM(UTC)


Groups: Registered
Posts: 31

I’m using LeadTools 14.5. I have PDF file that I want to load to codec so I can save to PNG. PDF file size is about 55 KB.

I already call RasterSupport.Unlock() to unlock RasterSupportType(Pdf, PdfAdvance, PdfRead & PdfSave). I have two PDF files and this very same code work when I try to save PDF to PNG for 1st PDF file only but it throw exception when I have try 2nd PDF file.

    // Resulting image pixel depth.
    codecs.Options.Pdf.Load.DisplayDepth = 24;
    codecs.Options.Pdf.Load.GraphicsAlpha = 4;
    codecs.Options.Pdf.Load.Password = @"";

    // Type of font anti-aliasing to use.
    codecs.Options.Pdf.Load.TextAlpha = 4;
    codecs.Options.Pdf.Load.UseLibFonts = true;

    // Horizontal,vertical  display resolution in dots per inch.
    codecs.Options.Pdf.Load.XResolution = 150;
    codecs.Options.Pdf.Load.YResolution = 150;

    IRasterImage tempImage;
    tempImage = codecs.Load(orgPDFFileFullPath, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1); //throw ex from here

    // Set access rights for the user when he\she opens the file we create
    codecs.Options.Pdf.Save.AssembleDocument = true;
    codecs.Options.Pdf.Save.ExtractText = true;
    codecs.Options.Pdf.Save.ExtractTextGraphics = true;
    codecs.Options.Pdf.Save.PrintDocument = false;
    codecs.Options.Pdf.Save.FillForm = true;
    codecs.Options.Pdf.Save.ModifyAnnotation = true;
    codecs.Options.Pdf.Save.ModifyDocument = true;
    codecs.Options.Pdf.Save.OwnerPassword = "Lead Technologies";
    codecs.Options.Pdf.Save.PrintFaithful = false;
    codecs.Options.Pdf.Save.TextEncoding = CodecsPdfTextEncoding.Hex;
    codecs.Options.Pdf.Save.Use128BitEncryption = true;
    codecs.Options.Pdf.Save.UserPassword = "Lead";

PDF file created by print RTF via free open source. The problem is not a PDF file because I can open it directly but when I load to codecs then it's throw exception below:

ex=System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at delete(Void* )
   at L_FreeThreadData()
   at Leadtools.Kernel.Codecs.Codec.fltInfo(Object pDispatch)
   at Leadtools.Kernel.Codecs.KernelCodecs.L_IntFileInfo(String pFilename, FILEINFO pInfo, UInt32 uStructSize, INFOLOADSTATE pState, Object pVector, Object pDocument, LOADFILEOPTION pLoadOptions, LOADDISPATCH pLoadDispatch)
   at Leadtools.Kernel.Codecs.KernelCodecs.L_FileInfo(String pFilename, FILEINFO pInfo, UInt32 uStructSize, UInt32 uFlags, LOADFILEOPTION pLoadOptions)
   at Leadtools.Codecs.RasterCodecs.GetInformation(String fileName, Stream stream, Boolean totalPages, Int32 pageNumber)
   at Leadtools.Codecs.RasterCodecs.Load(LoadParams loadParams)
   at Leadtools.Codecs.RasterCodecs.Load(String fileName, Int32 bitsPerPixel, CodecsLoadByteOrder order, Int32 firstPage, Int32 lastPage)

Is there something wrong with my code?

I also tried with existing PDF that I've printed out earlier but it throws same exception for all of them. Please help,


Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Friday, February 2, 2007 11:44:36 AM(UTC)


Groups: Registered, Tech Support, Administrators
Posts: 764

I do not see anything wrong off-hand, but it is just a snippet so there might be something else somewhere.

Anyways, what is the full version of the dlls you are using?  14.5.0.???  Perhaps this was a bug that has already been fixed in a more recent build.

Also, could you please post your PDF so we can test it as well?

NOTE: If you are attaching a project or file to the forums...
1.) Zip the file(s) up.
2.) Make sure it is less than 5 MB.  If it is larger, please send an email to support@leadtools.com or  give us your email address and we'll send you FTP instructions.
3.) Remove ANY AND ALL unlock codes and LEADTOOLS DLLs.
4.) Do not click the preview button, the attachment will not show up when you post it.
If you do not wish to post your file(s) on the forum since they are publically viewable, please send an email to support@leadtools.com and make sure that you include a link to this forum post.

#3 Posted : Thursday, March 1, 2007 11:14:25 AM(UTC)


Groups: Registered
Posts: 31

I've got latest build 40. I've re-compiled and test my program. It's work fine now. Thank you very much.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.172 seconds.