Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8383883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:16:43+00:00 2026-06-09T17:16:43+00:00

I’m having some problems with iText . (Specifically, iTextSharp.) I’m trying to split a

  • 0

I’m having some problems with iText. (Specifically, iTextSharp.) I’m trying to split a single large PDF file into a bunch of smaller ones. That’s not the issue; that works.

What I’m finding is that some(Just one; the rest remain embedded just fine.) of the fonts in the input PDF file, while they’re embedded in the input PDF file, are no longer embedded in the output PDF file, despite being copied with iText.

What this results in, in the end, is a readable output PDF file, that when opened in Adobe Reader, gives the error: “The font ‘ZurichBT-BoldItalic’ contains a bad /BBOX.”. The original input file has no problems.

I don’t really understand why.

Below is a test case application that will simply copy the input PDF. I can’t provide a sample of my own input PDF as it contains confidential information, but I’ll see about reproducing it with a small, simple file soon if this can’t be answered purely with code.


using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;

using iTextSharp;
using iTextSharp.text;
using iTextSharp.text.pdf;

static void Main(string[] args)
{
    PdfReader reader = new PdfReader("input.pdf");

    Document doc = new Document();
    PdfSmartCopy writer = new PdfSmartCopy(doc, new FileStream("output.pdf", fileMode.OpenOrCreate, FileAccess.Write));

    doc.Open();

    for (int i = 1; i <= reader.NumberOfPages; i++)
    {
        //byte[] page = reader.GetPageContent(i);
        //string data = ExtractTextFromPDFBytes(page);
        if (true)//data.Contains("Search Token"))
        {
            doc.SetPageSize(reader.GetPageSizeWithRotation(i));
            doc.NewPage();
            PdfImportedPage iPage = writer.GetImportedPage(reader, i);
            writer.AddPage(iPage);
        }
    }
    doc.Close();
}

Any ideas? 🙂

edit with more information

Having obtained another copy of the input pdf I was using, it seems the problem is with the input pdf, although the original input pdf has no errors that are detected by Adobe Reader. I can’t share the exact file, which makes this difficult, but I’m wondering if anyone has any theories as to how this could come about? File corruption or errors not apparent in a source pdf, that become apparent in an output pdf after being run through iText’s pdfCopy or pdfSmartCopy functions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:16:44+00:00Added an answer on June 9, 2026 at 5:16 pm

    This turned out to be due to a corrupt input PDF, even though no errors were apparent with the original source file. The code is fine, as BlackShadows indicates. Processing a different copy of the original source file resulted in correct output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to render a haml file in a javascript response like so:
I'm trying to create an if statement in PHP that prevents a single post
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm parsing an XML file, the creators of it stuck in a bunch social
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.