ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Determine if all even pages of PDF are Blank

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Sidney Egnew Posted - Nov 15 2024 : 02:48:16
How can I determine if the even numbered pages (backs) of a PDF file are blank?

Here is my code:

procedure TfmMain.ProcessDocument(const p_FileName: String);
var
  v_ImageView: TImageEnView;
  v_Index: Integer;
begin
  v_ImageView := TImageEnView.Create(nil);
  try
    try
      v_Index := 1;
      repeat
        v_ImageView.ClearAll;
        v_ImageView.IO.Params.FileName := p_FileName;
        v_ImageView.IO.Params.ImageIndex := v_Index;
        v_ImageView.IO.LoadFromFilePDF(p_FileName);
        LogMessage(p_FileName+' Page='+IntToStr(v_Index));
        // DETERMINE IF PAGE IS BLANK
        v_Index := v_Index+2;
      until v_Index >= V_ImageView.IO.Params.ImageCount;
    except
      on E: Exception do
        LogMessage(p_FileName+': Error '+E.Message);
    end;
  finally
    v_ImageView.Free;
  end;
end;

2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Nov 15 2024 : 17:15:50
Hi Sidney

Thanks for letting us know. We have improved the documentation.

Nigel
Xequte Software
www.imageen.com
Sidney Egnew Posted - Nov 15 2024 : 14:52:17
I was able to get this to work using:

v_ColorPercent := v_ImageView.Proc.GetDominantColor(v_RGB);
if v_ColorPercent > 99.9 then
  // Blank Page

All blank pages had a percentage > 99.9.

I posted the question because I found relevant messages and help content unclear on exactly how to use GetDominantColor. I needed to include the following to get it to work:

uses
  hyiedefs;
var
  v_ColorPercent: Double;
  v_RGB: TRGB;

Thanks