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

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, February 5, 2006 8:16:38 PM(UTC)

bkahn  
bkahn

Groups: Registered
Posts: 3


pdf to jpg
  
  Convert pdf file to jpg file and use L_LoadBitmap and L_SaveBitmap.

Target file is  bad and quality is loss.

What do I wrong  ?

============[ DPI problem ]==============

I search forum and find that DPI problem..
But can`t......

 LoadFileOption.XResolution = 96;
 LoadFileOption.YResolution = 96 or 72 or 300 or 400 or 1200  DPI change result same.....

==================================

========= [zip exe file]=================

input and output file attachment

1) double click

2) select target folder

3) bottom-left button

4) you can see....

===================================

///////////////////////////// [ Sample Code ] ///////////////////////////////////////////////////////////

SHORT CL_LeadFilterCtrl::CreateJPG(LPCTSTR Input, LPCTSTR Output)
{
 AFX_MANAGE_STATE(AfxGetStaticModuleState());

 Input="c:\\sample.pdf";
 Output="c:\\";

 //1. Declare the following variables:
 BITMAPHANDLE LeadBitmap = {0};         // LEAD bitmap
 FILEINFO FileInfo = {0};               // File info
 L_INT PageNumber, TotalPages;          // Page numbers
 LOADFILEOPTION LoadFileOption = {0};   // Loading options
 char szOutFileName[MAX_PATH];          // output file name

 //2. Find out the number of pages in the file
 L_FileInfo((L_TCHAR*)Input, &FileInfo, sizeof(FILEINFO), FILEINFO_TOTALPAGES, NULL);
 TotalPages = FileInfo.TotalPages;
 
  
 //3. Loop through the pages of the file
 L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
 LoadFileOption.XResolution = 96;
 LoadFileOption.YResolution = 96; ///// DPI change

 for (PageNumber=1; PageNumber<=TotalPages; ++PageNumber)
 {
 
  //4. Inside the loop, do the following:

  //4.1 Load the next image in the loop
  LoadFileOption.PageNumber = PageNumber;
  L_LoadBitmap((L_TCHAR*)Input, &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGRORGRAY, &LoadFileOption, NULL);
  
  //4.2 Check that it's properly loaded and allocated
  if(LeadBitmap.Flags.Allocated)
  {
  //4.3 Save page to a separate file
   wsprintf(szOutFileName, "%sPageNumber%4.4d.jpg",Output, PageNumber);
   L_SaveBitmap(szOutFileName, &LeadBitmap, FILE_JPEG_411, 24, 2, NULL);

  //4.4 Free image from memory
   L_FreeBitmap(&LeadBitmap);
  }
 }
 return SUCCESS;
}

 

oh plz >.<

 

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 : Monday, February 6, 2006 7:45:14 PM(UTC)

bkahn  
bkahn

Groups: Registered
Posts: 3


...

winzip 10.0

File Attachment(s):
s.zip (255kb) downloaded 39 time(s).
 
#3 Posted : Tuesday, February 7, 2006 9:54:09 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

To change the loading resolution of PDF files, you need to use the L_SetPDFOptions before loading.

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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.139 seconds.