I read a bank input file and create a tif output file comprised of the front and back images of checks. When I open the output tif file, I see only the front image.

I wrote a C# console application that reads a bank input file and writes a tif output file of the front image and back image of checks.

An input file instructs me as to the starting position and length of the 2 images (front and back) of each check within the bank input file.

Each front and back image of checks begins with the value "II*".

Thus, for the first check, I write out "II*" followed by the remaining bytes that comprise the remainder of the front image.

Then I write out "II*" followed by the remaining bytes that comprise the remainder of the back image.

And I repeat this process for every check in the input file.

When I open the tif file, it displays the front image of the check.

There is a navigation button to display the back image of the check.

If I click on the navigation button a few times, I can finally see the back image of the check.

Do you know if there is a way to write out the tif file so that each check is comprised of the lead characters "II*" followed by the front and back image of a check (in other words 1 "II*" value per check?

Here is a snippet of my code:

                    Array.Reverse(bytes1);

                    //intpos1 is assigned the record size of the Front Check Image
                    Int32 intpos1 = BitConverter.ToInt32(bytes1, 0);
                    //the lrecl for type 5 records with a fixed length at 252 bytes
                    //the Front and Back Check Image record sizes
                    //mulitplier1 is assigned then record size divided by 252 to find the number of whole lrecls
                    //and rounded up for any partial remainder less than 252
                    Int32 multiplier1 = (Int32)Math.Min(Math.Floor(intpos1 / 252D) + 1, Math.Ceiling(intpos1 / 252D));
                    Int32 intpos1revised = 252 * multiplier1;

                    //"bytes2" array is assigned the value of the record size of the Back Check Image record in
                    //positions 55 to 58 but since the index is 0 based, we begin the Skip value at position 54.
                    Byte[] bytes2 = res.Skip(54).Take(4).ToArray();
                    Array.Reverse(bytes2);

                    //intpos2 is assigned the record size of the Back Check Image (position 55 of the 58 type records
                    Int32 intpos2 = BitConverter.ToInt32(bytes2, 0);

                    Int32 multiplier2 = (Int32)Math.Min(Math.Floor(intpos2 / 252D) + 1, Math.Ceiling(intpos2 / 252D));
                    //The Back Image size value is rounded up to the next highest multipe of 252, the lrecl for type 55 records
                    Int32 intpos2revised = 252 * multiplier2;

                using (FileStream fs = new FileStream(bankFilePath, FileMode.Create))
                {
                    using (BinaryWriter bwrite = new BinaryWriter(fs))
                    {
                        foreach (var arr in result)
                        {
                            bwrite.Write(arr);
                        }
                    }
                }
zimmer9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:
Hopefully extracting both images on your other post will resolve this for you.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.