Отсутствует или ошибочен корневой объект pdf эдо

Подскажите плиз, что делать в такой ситуации, когда при открытии pdf, появляется окошко с таким текстом- Произошла ошибка при открытии дан�

Что делать в такой ситуации…?

Автор

Сообщение

Вставить имя в ответ
Перейти в профиль

dmitryi30

Репутация: 1

На сайте c 14.10.2016
Сообщений: 2
Санкт-Петербург

14.10.2016 19:24

Подскажите плиз, что делать в такой ситуации, когда при открытии pdf, появляется окошко с таким текстом- Произошла ошибка при открытии данного документа. Корневой объект отсутствует или является недопустимым.  Может стоит применить какой-нибудь инструмент для восстановления pdf ?

Вставить имя в ответ
Перейти в профиль

a.timofeev

Репутация: 4770

На сайте c 24.11.2009
Сообщений: 3189
Москва

14.10.2016 19:48

открой фотошопом или автокадом и если откроется норм — переставляй просмотрщик

Вставить имя в ответ
Перейти в профиль

HypnoticDen

Репутация: 414

На сайте c 02.08.2010
Сообщений: 77
Ukraine, Alchevsk

14.10.2016 19:53

Похоже на битый файл, хотя я за ПДФ такое никогда не замечал. Попробуйте открыть чем то сторонним, что бы исключить проблему софта. Например через онлайн просмотрщик ПДФ файлов

http://www.verysimple.ru/onlineviewer/ 

Вставить имя в ответ
Перейти в профиль

dmitryi30

Репутация: 1

На сайте c 14.10.2016
Сообщений: 2
Санкт-Петербург

16.10.2016 16:31

спасибо большое, попробую

Вставить имя в ответ
Перейти в профиль

volonterovv

Репутация: 1

На сайте c 16.10.2016
Сообщений: 3
Россия, Москва

19.10.2016 14:32

Не уверен, что это поможет вам на 100%, но все же попробуйте устранить ошибку с помощью этого инструмента называется Pdftk, скачайте и отремонтируйте. Лучшее что есть для восстановления, если файл сильно битый это такой инструментhttps://www.repairtoolbox.com/ru/pdfrepair.html
 

Вставить имя в ответ
Перейти в профиль

Arthas_Sapphire

Репутация: 2943

На сайте c 08.08.2014
Сообщений: 405
Москва

EARLDK:
Я предупреждал.

Флейм. Оскорбления или «наезды» на других участников форума, неуважительное к ним отношение. Споры с переходом на личности, провокации на скандал и т.д.

Пожизненный бан

19.10.2016 14:37

Цитата dmitryi30:

Корневой объект отсутствует или является недопустимым.

это значит что этому объекту хана: начинка была вставленна как ссылка на другой 1 или несколько объектов и зашита в пдф. в общем ищите другой файл. )

wrooot

Participant

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/td-p/9991264
Jul 18, 2018
Jul 18, 2018

Copy link to clipboard

Copied

A few employees have reported problems when opening some documents. 2018.011.20055 version shows «The root object is missing or invalid» error. A bit older 20035 version shows «There was a problem reading this document (14)». But i can open such document with Chrome and even older Reader XI version or Acrobat 9 version. So, it seems there is some problem with a document, but recent Reader versions are more affected by this and can’t open it. Is there any way to avoid this, maybe some update can make Reader more accepting/ignore such errors. They seem like a minor thing as document looks perfect in Chrome or Reader XI. I can’t share any document as they are private and i’m not able to reproduce it myself with some test document. Last document that i saw has «Merged» in its name. It looks like a few paper documents were scanned and then separate pdfs merged with some tool into one piece. Probably that tool does something incorrectly when merging.

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

replies
2
Replies
2

vivienm84604229

New Here

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/m-p/9991265#M43809
Sep 20, 2018
Sep 20, 2018

Copy link to clipboard

Copied

Hey wrooot,

I  have exactly the same problem (same error, Reader Version…).

Have you found any Solutions yet?

If so pls share.

Thank You very much

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Test Screen Name

LEGEND

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/m-p/9991266#M43810
Sep 20, 2018
Sep 20, 2018

Copy link to clipboard

Copied

LATEST

In Response To vivienm84604229

Do you have any file you can share publicly?

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

wrooot

Participant

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/td-p/9991264
Jul 18, 2018
Jul 18, 2018

Copy link to clipboard

Copied

A few employees have reported problems when opening some documents. 2018.011.20055 version shows «The root object is missing or invalid» error. A bit older 20035 version shows «There was a problem reading this document (14)». But i can open such document with Chrome and even older Reader XI version or Acrobat 9 version. So, it seems there is some problem with a document, but recent Reader versions are more affected by this and can’t open it. Is there any way to avoid this, maybe some update can make Reader more accepting/ignore such errors. They seem like a minor thing as document looks perfect in Chrome or Reader XI. I can’t share any document as they are private and i’m not able to reproduce it myself with some test document. Last document that i saw has «Merged» in its name. It looks like a few paper documents were scanned and then separate pdfs merged with some tool into one piece. Probably that tool does something incorrectly when merging.

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

replies
2
Replies
2

vivienm84604229

New Here

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/m-p/9991265#M43809
Sep 20, 2018
Sep 20, 2018

Copy link to clipboard

Copied

Hey wrooot,

I  have exactly the same problem (same error, Reader Version…).

Have you found any Solutions yet?

If so pls share.

Thank You very much

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Test Screen Name

LEGEND

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/m-p/9991266#M43810
Sep 20, 2018
Sep 20, 2018

Copy link to clipboard

Copied

LATEST

In Response To vivienm84604229

Do you have any file you can share publicly?

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Hi

I facing issue while opening pdf while it give me erroe as There was an error in opening document,root object is missing or invalid

I use following code for pdf ,
In temporay folder it created new decrypted file on click of preview button that decrypted file is open.this code is working fine for all pdf,just failed for one particualr pdf.only for one particular pdf it giving me error as

There was an error in opening document,root object is missing or invalid</b>

what to do in such case?

private void ListFieldNames()
{
int formID = 0;
string formName = «»;
bool isDeleted = false;
DataTable formIDTable = new DataTable();
try
{

PdfReader pdfReader = null;
isApplInfo = 1;

if (this.CalledFrom != «1»)
{
pdfForm = ucmbForm.SelectedRow.Cells[«FormFileName»].Value.ToString();

Client client = new Client();
pdfTemplate = client.GetApplicationFolderPath(ApplicationUser.LicenseType) + @»» + pdfForm + «»;
}
else
{
pdfForm = Path.GetFileName(utxtBrowse.Text.Trim());
pdfTemplate = utxtBrowse.Text.Trim();
}
decryptedPDFPath = localPath + @»» + ConfigurationSettings.AppSettings[«TempFilesPath»] + @»DecryptPDFFolder»;

if (!Directory.Exists(decryptedPDFPath))
{
Directory.CreateDirectory(decryptedPDFPath);
}

int i = 0;
decryptedPDFPath = decryptedPDFPath + @»» + pdfForm + «»;

Security security = new Security();

if (File.Exists(decryptedPDFPath))
{
File.Delete(decryptedPDFPath);
}
if (File.Exists(pdfTemplate))
{
isFilepresent = 0;
try
{
if (calledFrom == «»)
{
security.DecryptFile256(«DSSIPL», pdfTemplate, decryptedPDFPath); pdfReader = new PdfReader(decryptedPDFPath);
}
else
{
File.Copy(pdfTemplate, decryptedPDFPath, true);
pdfReader = new PdfReader(decryptedPDFPath);
}

}
catch
{
if (calledFrom == «1»)
{
File.Copy(pdfTemplate, decryptedPDFPath, true);
}
pdfReader = new PdfReader(decryptedPDFPath);
}

arrayPdffields = new string[pdfReader.AcroFields.Fields.Count];

foreach (DictionaryEntry dictionaryentry in pdfReader.AcroFields.Fields)
{

arrayPdffields[i] = dictionaryentry.Key.ToString();
i = i + 1;
}
pdfReader.Close();
}
else
{
isFilepresent = 1;
UltraMessageBox.Show(» The PDF file of the form that you have selected is missing.n Please download this form again»,
applicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);

formID = Convert.ToInt32(ucmbForm.Value);
formName = Convert.ToString(ucmbForm.Text);
formIDTable.Columns.Add(«FormID», typeof(System.Int32));
formIDTable.Columns.Add(«FormName», typeof(System.String));
formIDTable.Rows.Add(new object[] { formID, formName });
isDeleted = iApplicationFormsBridge.DeleteDispatchFormsRows(formIDTable);
if (isDeleted)
{
FillForm();
}
isDeleted = false;
}
}
catch
{
throw;
}
}

internal void DecryptFile256(string strKey, string fileNameInput, string fileNameOutput)
{
Stream fileIn = null;
Stream fileOut = null;
MemoryStream decStream = null;

try
{
fileIn = OpenFile(fileNameInput, FileMode.Open, FileAccess.Read);
fileOut = OpenFile(fileNameOutput, FileMode.OpenOrCreate, FileAccess.Write);
decStream = DecryptStream256(strKey, fileIn); decStream.WriteTo(fileOut);
}
catch
{
throw;
}
finally
{
fileIn.Close();
fileOut.Close();
decStream = null;
}
}

}
internal MemoryStream DecryptStream256(string strKey, Stream inputStream)
{
byte[] byteKey = null;
byte[] buff = null;
int lenRead = 0;
Cryptography.CryptoStream decStream = null;
MemoryStream outputStream = null;
Cryptography.SymmetricAlgorithm objSymmAlgorithm = null;

try
{
buff = new byte[1000];//decryption buffer.
byteKey = GetByteKeys256(strKey);

outputStream = new MemoryStream();

objSymmAlgorithm = new Cryptography.RijndaelManaged();

decStream = new Cryptography.CryptoStream(outputStream, objSymmAlgorithm.CreateDecryptor(byteKey, VECTOR_IV_256), Cryptography.CryptoStreamMode.Write);
//do the deryption …
inputStream.Position = 0;
while( (lenRead = inputStream.Read(buff, 0,buff.Length))>0)
{
decStream.Write(buff, 0, lenRead);
}
decStream.FlushFinalBlock();
outputStream.Flush();
return outputStream;
}
catch
{
throw;
}
finally
{
objSymmAlgorithm = null;
decStream = null;
byteKey = null;
buff = null;
}
}

Hi

I facing issue while opening pdf while it give me erroe as There was an error in opening document,root object is missing or invalid

I use following code for pdf ,
In temporay folder it created new decrypted file on click of preview button that decrypted file is open.this code is working fine for all pdf,just failed for one particualr pdf.only for one particular pdf it giving me error as

There was an error in opening document,root object is missing or invalid</b>

what to do in such case?

private void ListFieldNames()
{
int formID = 0;
string formName = «»;
bool isDeleted = false;
DataTable formIDTable = new DataTable();
try
{

PdfReader pdfReader = null;
isApplInfo = 1;

if (this.CalledFrom != «1»)
{
pdfForm = ucmbForm.SelectedRow.Cells[«FormFileName»].Value.ToString();

Client client = new Client();
pdfTemplate = client.GetApplicationFolderPath(ApplicationUser.LicenseType) + @»» + pdfForm + «»;
}
else
{
pdfForm = Path.GetFileName(utxtBrowse.Text.Trim());
pdfTemplate = utxtBrowse.Text.Trim();
}
decryptedPDFPath = localPath + @»» + ConfigurationSettings.AppSettings[«TempFilesPath»] + @»DecryptPDFFolder»;

if (!Directory.Exists(decryptedPDFPath))
{
Directory.CreateDirectory(decryptedPDFPath);
}

int i = 0;
decryptedPDFPath = decryptedPDFPath + @»» + pdfForm + «»;

Security security = new Security();

if (File.Exists(decryptedPDFPath))
{
File.Delete(decryptedPDFPath);
}
if (File.Exists(pdfTemplate))
{
isFilepresent = 0;
try
{
if (calledFrom == «»)
{
security.DecryptFile256(«DSSIPL», pdfTemplate, decryptedPDFPath); pdfReader = new PdfReader(decryptedPDFPath);
}
else
{
File.Copy(pdfTemplate, decryptedPDFPath, true);
pdfReader = new PdfReader(decryptedPDFPath);
}

}
catch
{
if (calledFrom == «1»)
{
File.Copy(pdfTemplate, decryptedPDFPath, true);
}
pdfReader = new PdfReader(decryptedPDFPath);
}

arrayPdffields = new string[pdfReader.AcroFields.Fields.Count];

foreach (DictionaryEntry dictionaryentry in pdfReader.AcroFields.Fields)
{

arrayPdffields[i] = dictionaryentry.Key.ToString();
i = i + 1;
}
pdfReader.Close();
}
else
{
isFilepresent = 1;
UltraMessageBox.Show(» The PDF file of the form that you have selected is missing.n Please download this form again»,
applicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);

formID = Convert.ToInt32(ucmbForm.Value);
formName = Convert.ToString(ucmbForm.Text);
formIDTable.Columns.Add(«FormID», typeof(System.Int32));
formIDTable.Columns.Add(«FormName», typeof(System.String));
formIDTable.Rows.Add(new object[] { formID, formName });
isDeleted = iApplicationFormsBridge.DeleteDispatchFormsRows(formIDTable);
if (isDeleted)
{
FillForm();
}
isDeleted = false;
}
}
catch
{
throw;
}
}

internal void DecryptFile256(string strKey, string fileNameInput, string fileNameOutput)
{
Stream fileIn = null;
Stream fileOut = null;
MemoryStream decStream = null;

try
{
fileIn = OpenFile(fileNameInput, FileMode.Open, FileAccess.Read);
fileOut = OpenFile(fileNameOutput, FileMode.OpenOrCreate, FileAccess.Write);
decStream = DecryptStream256(strKey, fileIn); decStream.WriteTo(fileOut);
}
catch
{
throw;
}
finally
{
fileIn.Close();
fileOut.Close();
decStream = null;
}
}

}
internal MemoryStream DecryptStream256(string strKey, Stream inputStream)
{
byte[] byteKey = null;
byte[] buff = null;
int lenRead = 0;
Cryptography.CryptoStream decStream = null;
MemoryStream outputStream = null;
Cryptography.SymmetricAlgorithm objSymmAlgorithm = null;

try
{
buff = new byte[1000];//decryption buffer.
byteKey = GetByteKeys256(strKey);

outputStream = new MemoryStream();

objSymmAlgorithm = new Cryptography.RijndaelManaged();

decStream = new Cryptography.CryptoStream(outputStream, objSymmAlgorithm.CreateDecryptor(byteKey, VECTOR_IV_256), Cryptography.CryptoStreamMode.Write);
//do the deryption …
inputStream.Position = 0;
while( (lenRead = inputStream.Read(buff, 0,buff.Length))>0)
{
decStream.Write(buff, 0, lenRead);
}
decStream.FlushFinalBlock();
outputStream.Flush();
return outputStream;
}
catch
{
throw;
}
finally
{
objSymmAlgorithm = null;
decStream = null;
byteKey = null;
buff = null;
}
}

Этот корневой объект PDF приведет к сбою Adobe Reader. Другие программы для чтения PDF, такие как Foxit, Nuance, Evince, SumatraPDF, без проблем откроют файл PDF. Проблема заключается в том, что /Dests требует косвенного объекта (ссылка в формате PDF). Удаление /Dests << >> приведет к тому, что Adobe Reader откроет файл, но не сможет распечатать его. Все остальные читатели работают нормально без /Dests. Есть идеи, как исправить синтаксис в следующем примере корневого объекта?

  17 0 obj
  <<
    /Type /Catalog
    /Pages 2 0 R
    /Outlines 15 0 R
    /PageMode /UseOutlines
    /Dests <<
             /__WKANCHOR_2 8 0 R
             /#8d#c2#ca#ebs#e4#60#00#9e#97l#b9#80#1b#cb#86sQR#83 9 0 R
           >>
  >>
  endobj

3 ответа

Хорошо, нашел несколько свободных минут…

Итак, первое, что я заметил, это то, что *все другие программы чтения действительно могут открыть файл (я протестировал лишь некоторые из них). Но они выдают много-много предупреждений и сообщений об ошибках… (Попробуйте Ghostscript: gs virkerikke.pdf или попробуйте evince…) В PDF также есть как минимум поврежденная таблица xref (или, по крайней мере, это одна из жалоб).

xpdf жалуется:

[....]
Error: Invalid XRef entry
Error: Invalid XRef entry
Error: Invalid XRef entry
Error (157): Unterminated string
Error (159): End of file inside dictionary

gv жалуется:

Warning: translation table syntax error: Unknown keysym name:  apLineDel
Warning: ... found while parsing '<Key>apLineDel:   GV_Page(page+5)     '
Warning: String to TranslationTable conversion encountered errors

evince жалуется:

[....]
Error: Invalid XRef entry
Error: Invalid XRef entry
Error: Invalid XRef entry
Error (157): Unterminated string
Error (159): End of file inside dictionary
Error (157): Unterminated string
Error (159): End of file inside dictionary
Error (157): Unterminated string
Error (159): End of file inside dictionary
[....]
Error (1918): Unterminated string
Error (1920): End of file inside dictionary

gs жалуется:

**** Warning: File has a corrupted %%EOF marker, or garbage after %%EOF.

mupdf жалуется:

+ pdf/pdf_xref.c:60: pdf_read_start_xref(): cannot find startxref
| pdf/pdf_xref.c:477: pdf_load_xref(): cannot read startxref
 pdf/pdf_xref.c:532: pdf_open_xref_with_stream(): trying to repair
warning: ignoring invalid character in hex string: '!'
warning: ignoring invalid character in hex string: 'O'
warning: ignoring invalid character in hex string: 'T'
warning: ignoring invalid character in hex string: 'Y'
[....]

qpdf --qdf жалуется:

virkerikke.pdf (object 17 0, file position 2234): null character not allowed in name token

Хорошо, теперь открываем этот паршивый файл в текстовом редакторе и пытаемся его восстановить. Я обнаружил, что этот файл (размером 32746 байт) имеет серьезные проблемы с синтаксисом:

  1. Мусор после %%EOF: полный HTML-файл с правильным синтаксисом приклеен к PDF-файлу после маркера %%EOF с заголовком «Wkhtmltopdf — Teknisk regelverk» . Его размер составляет 11878 байт. Удалите эту часть, и у вас будет «лучший» PDF-файл размером всего 20868 байт… хотя Acrobat/Adobe Reader по-прежнему не открывает его после сохранения отредактированного файла.
  2. Недопустимый символ в маркере имени: он находится внутри маркера имени /#8d#c2#ca#ebs#e4#60#00#9e#97l#b9#80#1b#cb#86sQR#83. В этом файле он появляется 2 раза. Уже в моих первых комментариях я сказал вам, что этот ключ не выглядит заслуживающим доверия, потому что он содержит очень мало символов ASCII, но много двоичных байтов (используя их шестнадцатеричное представление. (Что я упустил из виду, так это то, что он даже содержал #00, который является представлением PDF для символа nul… использование которого является незаконным для токенов имен в PDF.) Замените этот токен имени другим (фантазийным) точно такой же длины ( в обоих случаях). Я выбрал /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. Сохраните отредактированный файл.

Теперь даже программы Acrobat/Adobe Readers будут без проблем открывать этот восстановленный файл. Кроме того, ‘другие читатели’ теперь будут лучше работать с этим файлом, выдавая меньше предупреждений и теперь имея возможность идентифицировать некоторые метаданные (такие как дата создания и производитель == wkhtmltopdf), которые они не смогли определить. добраться до исходного файла.


3

Kurt Pfeifle
3 Июн 2011 в 04:49

/Dests должен быть словарем (пары /Key value), содержащим имена (ключи) и соответствующие адресаты (значения). Ключевое слово /Dests впервые появилось в PDF 1.1.

PDF 1.1 допускал, чтобы ключи были только объектом имени. В PDF 1.2 ключи также могут быть строками байтов.

Итак, за какую версию PDF претендует ваш файл?

Из спецификации PDF 1.7 («ISO 32000-1»), описывающей значение /Dests:

В PDF 1.1 соответствие между объектами имен и местами назначения должно определяться записью Dests в каталоге документов (см. 7.7.2, «Каталог документов»). Значение этой записи должно быть словарем, в котором каждый ключ является именем адресата, а соответствующее значение является либо массивом, определяющим адресата, с использованием синтаксиса, показанного в таблице 151, либо словарем с элементом D, значение которого является таким массивом. .


1

Kurt Pfeifle
2 Июн 2011 в 12:53

Кажется довольно простым. Переместите массив dedes в отдельный объект.

Скорее, чем

17 0 obj
<<
  /Type /Catalog
  /Pages 2 0 R
  /Outlines 15 0 R
  /PageMode /UseOutlines
  /Dests <<
    /__WKANCHOR_2 8 0 R
    /#8d#c2#ca#ebs#e4#60#00#9e#97l#b9#80#1b#cb#86sQR#83 9 0 R
  >>
>>
endobj

Вместо этого вы должны иметь:

17 0 obj
<<
  /Type /Catalog
  /Pages 2 0 R
  /Outlines 15 0 R
  /PageMode /UseOutlines
  /Dests 1234 0 R
>>
endobj
1234 0 obj
<</__WKANCHOR_2 8 0 R/#8d#c2#ca#ebs#e4#60#00#9e#97l#b9#80#1b#cb#86sQR#83 9 0 R>>
endobj

Номер объекта будет чем-то псевдослучайным.

И то, как переместить массив dest из корня в отдельный объект, будет полностью зависеть от того, какое программное обеспечение PDF вы используете. «Шестнадцатеричный редактор» — это вариант, но тогда вы перейдете на SuperUser, а не на StackOverflow… технически. Я подозреваю, что вы могли бы получить mulligan на этом. Я бы позволил этому соскользнуть сам.


0

Mark Storer
6 Июн 2011 в 21:40

Что делать в такой ситуации…?

Автор

Сообщение

Вставить имя в ответ
Перейти в профиль

dmitryi30

Репутация: 1

На сайте c 14.10.2016
Сообщений: 2
Санкт-Петербург

14.10.2016 19:24

Подскажите плиз, что делать в такой ситуации, когда при открытии pdf, появляется окошко с таким текстом- Произошла ошибка при открытии данного документа. Корневой объект отсутствует или является недопустимым.  Может стоит применить какой-нибудь инструмент для восстановления pdf ?

Вставить имя в ответ
Перейти в профиль

a.timofeev

Репутация: 4790

На сайте c 24.11.2009
Сообщений: 3199
Москва

14.10.2016 19:48

открой фотошопом или автокадом и если откроется норм — переставляй просмотрщик

Вставить имя в ответ
Перейти в профиль

HypnoticDen

Репутация: 414

На сайте c 02.08.2010
Сообщений: 77
Ukraine, Alchevsk

14.10.2016 19:53

Похоже на битый файл, хотя я за ПДФ такое никогда не замечал. Попробуйте открыть чем то сторонним, что бы исключить проблему софта. Например через онлайн просмотрщик ПДФ файлов

http://www.verysimple.ru/onlineviewer/ 

Вставить имя в ответ
Перейти в профиль

dmitryi30

Репутация: 1

На сайте c 14.10.2016
Сообщений: 2
Санкт-Петербург

16.10.2016 16:31

спасибо большое, попробую

Вставить имя в ответ
Перейти в профиль

volonterovv

Репутация: 1

На сайте c 16.10.2016
Сообщений: 3
Россия, Москва

19.10.2016 14:32

Не уверен, что это поможет вам на 100%, но все же попробуйте устранить ошибку с помощью этого инструмента называется Pdftk, скачайте и отремонтируйте. Лучшее что есть для восстановления, если файл сильно битый это такой инструментhttps://www.repairtoolbox.com/ru/pdfrepair.html
 

Вставить имя в ответ
Перейти в профиль

Arthas_Sapphire

Репутация: 2942

На сайте c 08.08.2014
Сообщений: 405
Москва

EARLDK:
Я предупреждал.

Флейм. Оскорбления или «наезды» на других участников форума, неуважительное к ним отношение. Споры с переходом на личности, провокации на скандал и т.д.

Пожизненный бан

19.10.2016 14:37

Цитата dmitryi30:

Корневой объект отсутствует или является недопустимым.

это значит что этому объекту хана: начинка была вставленна как ссылка на другой 1 или несколько объектов и зашита в пдф. в общем ищите другой файл. )

Hi

I facing issue while opening pdf while it give me erroe as There was an error in opening document,root object is missing or invalid

I use following code for pdf ,
In temporay folder it created new decrypted file on click of preview button that decrypted file is open.this code is working fine for all pdf,just failed for one particualr pdf.only for one particular pdf it giving me error as

There was an error in opening document,root object is missing or invalid</b>

what to do in such case?

private void ListFieldNames()
{
int formID = 0;
string formName = «»;
bool isDeleted = false;
DataTable formIDTable = new DataTable();
try
{

PdfReader pdfReader = null;
isApplInfo = 1;

if (this.CalledFrom != «1»)
{
pdfForm = ucmbForm.SelectedRow.Cells[«FormFileName»].Value.ToString();

Client client = new Client();
pdfTemplate = client.GetApplicationFolderPath(ApplicationUser.LicenseType) + @»» + pdfForm + «»;
}
else
{
pdfForm = Path.GetFileName(utxtBrowse.Text.Trim());
pdfTemplate = utxtBrowse.Text.Trim();
}
decryptedPDFPath = localPath + @»» + ConfigurationSettings.AppSettings[«TempFilesPath»] + @»DecryptPDFFolder»;

if (!Directory.Exists(decryptedPDFPath))
{
Directory.CreateDirectory(decryptedPDFPath);
}

int i = 0;
decryptedPDFPath = decryptedPDFPath + @»» + pdfForm + «»;

Security security = new Security();

if (File.Exists(decryptedPDFPath))
{
File.Delete(decryptedPDFPath);
}
if (File.Exists(pdfTemplate))
{
isFilepresent = 0;
try
{
if (calledFrom == «»)
{
security.DecryptFile256(«DSSIPL», pdfTemplate, decryptedPDFPath); pdfReader = new PdfReader(decryptedPDFPath);
}
else
{
File.Copy(pdfTemplate, decryptedPDFPath, true);
pdfReader = new PdfReader(decryptedPDFPath);
}

}
catch
{
if (calledFrom == «1»)
{
File.Copy(pdfTemplate, decryptedPDFPath, true);
}
pdfReader = new PdfReader(decryptedPDFPath);
}

arrayPdffields = new string[pdfReader.AcroFields.Fields.Count];

foreach (DictionaryEntry dictionaryentry in pdfReader.AcroFields.Fields)
{

arrayPdffields[i] = dictionaryentry.Key.ToString();
i = i + 1;
}
pdfReader.Close();
}
else
{
isFilepresent = 1;
UltraMessageBox.Show(» The PDF file of the form that you have selected is missing.n Please download this form again»,
applicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);

formID = Convert.ToInt32(ucmbForm.Value);
formName = Convert.ToString(ucmbForm.Text);
formIDTable.Columns.Add(«FormID», typeof(System.Int32));
formIDTable.Columns.Add(«FormName», typeof(System.String));
formIDTable.Rows.Add(new object[] { formID, formName });
isDeleted = iApplicationFormsBridge.DeleteDispatchFormsRows(formIDTable);
if (isDeleted)
{
FillForm();
}
isDeleted = false;
}
}
catch
{
throw;
}
}

internal void DecryptFile256(string strKey, string fileNameInput, string fileNameOutput)
{
Stream fileIn = null;
Stream fileOut = null;
MemoryStream decStream = null;

try
{
fileIn = OpenFile(fileNameInput, FileMode.Open, FileAccess.Read);
fileOut = OpenFile(fileNameOutput, FileMode.OpenOrCreate, FileAccess.Write);
decStream = DecryptStream256(strKey, fileIn); decStream.WriteTo(fileOut);
}
catch
{
throw;
}
finally
{
fileIn.Close();
fileOut.Close();
decStream = null;
}
}

}
internal MemoryStream DecryptStream256(string strKey, Stream inputStream)
{
byte[] byteKey = null;
byte[] buff = null;
int lenRead = 0;
Cryptography.CryptoStream decStream = null;
MemoryStream outputStream = null;
Cryptography.SymmetricAlgorithm objSymmAlgorithm = null;

try
{
buff = new byte[1000];//decryption buffer.
byteKey = GetByteKeys256(strKey);

outputStream = new MemoryStream();

objSymmAlgorithm = new Cryptography.RijndaelManaged();

decStream = new Cryptography.CryptoStream(outputStream, objSymmAlgorithm.CreateDecryptor(byteKey, VECTOR_IV_256), Cryptography.CryptoStreamMode.Write);
//do the deryption …
inputStream.Position = 0;
while( (lenRead = inputStream.Read(buff, 0,buff.Length))>0)
{
decStream.Write(buff, 0, lenRead);
}
decStream.FlushFinalBlock();
outputStream.Flush();
return outputStream;
}
catch
{
throw;
}
finally
{
objSymmAlgorithm = null;
decStream = null;
byteKey = null;
buff = null;
}
}

Hi

I facing issue while opening pdf while it give me erroe as There was an error in opening document,root object is missing or invalid

I use following code for pdf ,
In temporay folder it created new decrypted file on click of preview button that decrypted file is open.this code is working fine for all pdf,just failed for one particualr pdf.only for one particular pdf it giving me error as

There was an error in opening document,root object is missing or invalid</b>

what to do in such case?

private void ListFieldNames()
{
int formID = 0;
string formName = «»;
bool isDeleted = false;
DataTable formIDTable = new DataTable();
try
{

PdfReader pdfReader = null;
isApplInfo = 1;

if (this.CalledFrom != «1»)
{
pdfForm = ucmbForm.SelectedRow.Cells[«FormFileName»].Value.ToString();

Client client = new Client();
pdfTemplate = client.GetApplicationFolderPath(ApplicationUser.LicenseType) + @»» + pdfForm + «»;
}
else
{
pdfForm = Path.GetFileName(utxtBrowse.Text.Trim());
pdfTemplate = utxtBrowse.Text.Trim();
}
decryptedPDFPath = localPath + @»» + ConfigurationSettings.AppSettings[«TempFilesPath»] + @»DecryptPDFFolder»;

if (!Directory.Exists(decryptedPDFPath))
{
Directory.CreateDirectory(decryptedPDFPath);
}

int i = 0;
decryptedPDFPath = decryptedPDFPath + @»» + pdfForm + «»;

Security security = new Security();

if (File.Exists(decryptedPDFPath))
{
File.Delete(decryptedPDFPath);
}
if (File.Exists(pdfTemplate))
{
isFilepresent = 0;
try
{
if (calledFrom == «»)
{
security.DecryptFile256(«DSSIPL», pdfTemplate, decryptedPDFPath); pdfReader = new PdfReader(decryptedPDFPath);
}
else
{
File.Copy(pdfTemplate, decryptedPDFPath, true);
pdfReader = new PdfReader(decryptedPDFPath);
}

}
catch
{
if (calledFrom == «1»)
{
File.Copy(pdfTemplate, decryptedPDFPath, true);
}
pdfReader = new PdfReader(decryptedPDFPath);
}

arrayPdffields = new string[pdfReader.AcroFields.Fields.Count];

foreach (DictionaryEntry dictionaryentry in pdfReader.AcroFields.Fields)
{

arrayPdffields[i] = dictionaryentry.Key.ToString();
i = i + 1;
}
pdfReader.Close();
}
else
{
isFilepresent = 1;
UltraMessageBox.Show(» The PDF file of the form that you have selected is missing.n Please download this form again»,
applicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);

formID = Convert.ToInt32(ucmbForm.Value);
formName = Convert.ToString(ucmbForm.Text);
formIDTable.Columns.Add(«FormID», typeof(System.Int32));
formIDTable.Columns.Add(«FormName», typeof(System.String));
formIDTable.Rows.Add(new object[] { formID, formName });
isDeleted = iApplicationFormsBridge.DeleteDispatchFormsRows(formIDTable);
if (isDeleted)
{
FillForm();
}
isDeleted = false;
}
}
catch
{
throw;
}
}

internal void DecryptFile256(string strKey, string fileNameInput, string fileNameOutput)
{
Stream fileIn = null;
Stream fileOut = null;
MemoryStream decStream = null;

try
{
fileIn = OpenFile(fileNameInput, FileMode.Open, FileAccess.Read);
fileOut = OpenFile(fileNameOutput, FileMode.OpenOrCreate, FileAccess.Write);
decStream = DecryptStream256(strKey, fileIn); decStream.WriteTo(fileOut);
}
catch
{
throw;
}
finally
{
fileIn.Close();
fileOut.Close();
decStream = null;
}
}

}
internal MemoryStream DecryptStream256(string strKey, Stream inputStream)
{
byte[] byteKey = null;
byte[] buff = null;
int lenRead = 0;
Cryptography.CryptoStream decStream = null;
MemoryStream outputStream = null;
Cryptography.SymmetricAlgorithm objSymmAlgorithm = null;

try
{
buff = new byte[1000];//decryption buffer.
byteKey = GetByteKeys256(strKey);

outputStream = new MemoryStream();

objSymmAlgorithm = new Cryptography.RijndaelManaged();

decStream = new Cryptography.CryptoStream(outputStream, objSymmAlgorithm.CreateDecryptor(byteKey, VECTOR_IV_256), Cryptography.CryptoStreamMode.Write);
//do the deryption …
inputStream.Position = 0;
while( (lenRead = inputStream.Read(buff, 0,buff.Length))>0)
{
decStream.Write(buff, 0, lenRead);
}
decStream.FlushFinalBlock();
outputStream.Flush();
return outputStream;
}
catch
{
throw;
}
finally
{
objSymmAlgorithm = null;
decStream = null;
byteKey = null;
buff = null;
}
}

wrooot

Participant

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/td-p/9991264
Jul 18, 2018
Jul 18, 2018

Copy link to clipboard

Copied

A few employees have reported problems when opening some documents. 2018.011.20055 version shows «The root object is missing or invalid» error. A bit older 20035 version shows «There was a problem reading this document (14)». But i can open such document with Chrome and even older Reader XI version or Acrobat 9 version. So, it seems there is some problem with a document, but recent Reader versions are more affected by this and can’t open it. Is there any way to avoid this, maybe some update can make Reader more accepting/ignore such errors. They seem like a minor thing as document looks perfect in Chrome or Reader XI. I can’t share any document as they are private and i’m not able to reproduce it myself with some test document. Last document that i saw has «Merged» in its name. It looks like a few paper documents were scanned and then separate pdfs merged with some tool into one piece. Probably that tool does something incorrectly when merging.

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

replies
2
Replies
2

vivienm84604229

New Here

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/m-p/9991265#M43809
Sep 20, 2018
Sep 20, 2018

Copy link to clipboard

Copied

Hey wrooot,

I  have exactly the same problem (same error, Reader Version…).

Have you found any Solutions yet?

If so pls share.

Thank You very much

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Test Screen Name

LEGEND

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/m-p/9991266#M43810
Sep 20, 2018
Sep 20, 2018

Copy link to clipboard

Copied

LATEST

In Response To vivienm84604229

Do you have any file you can share publicly?

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

wrooot

Participant

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/td-p/9991264
Jul 18, 2018
Jul 18, 2018

Copy link to clipboard

Copied

A few employees have reported problems when opening some documents. 2018.011.20055 version shows «The root object is missing or invalid» error. A bit older 20035 version shows «There was a problem reading this document (14)». But i can open such document with Chrome and even older Reader XI version or Acrobat 9 version. So, it seems there is some problem with a document, but recent Reader versions are more affected by this and can’t open it. Is there any way to avoid this, maybe some update can make Reader more accepting/ignore such errors. They seem like a minor thing as document looks perfect in Chrome or Reader XI. I can’t share any document as they are private and i’m not able to reproduce it myself with some test document. Last document that i saw has «Merged» in its name. It looks like a few paper documents were scanned and then separate pdfs merged with some tool into one piece. Probably that tool does something incorrectly when merging.

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

replies
2
Replies
2

vivienm84604229

New Here

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/m-p/9991265#M43809
Sep 20, 2018
Sep 20, 2018

Copy link to clipboard

Copied

Hey wrooot,

I  have exactly the same problem (same error, Reader Version…).

Have you found any Solutions yet?

If so pls share.

Thank You very much

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Test Screen Name

LEGEND

,

/t5/acrobat-reader-discussions/the-root-object-is-missing-or-invalid-error/m-p/9991266#M43810
Sep 20, 2018
Sep 20, 2018

Copy link to clipboard

Copied

LATEST

In Response To vivienm84604229

Do you have any file you can share publicly?

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

ОК, нашел несколько запасных минут…

Итак, первое, что я заметил, это то, что * все остальные читатели действительно могут открыть файл (я только тестировал несколько). Но они выплевывают много и много предупреждений и сообщений об ошибках… (Попробуйте Ghostscript: gs virkerikke.pdf или попробуйте evince…) В PDF есть как минимум поврежденная таблица xref (или, по крайней мере, это одна из жалоб).

xpdf жалуется:

[....]
Error: Invalid XRef entry
Error: Invalid XRef entry
Error: Invalid XRef entry
Error (157): Unterminated string
Error (159): End of file inside dictionary

gv жалуется:

Warning: translation table syntax error: Unknown keysym name:  apLineDel
Warning: ... found while parsing '<Key>apLineDel: GV_Page(page+5) '
Warning: String to TranslationTable conversion encountered errors

evince жалуется:

[....]
Error: Invalid XRef entry
Error: Invalid XRef entry
Error: Invalid XRef entry
Error (157): Unterminated string
Error (159): End of file inside dictionary
Error (157): Unterminated string
Error (159): End of file inside dictionary
Error (157): Unterminated string
Error (159): End of file inside dictionary
[....]
Error (1918): Unterminated string
Error (1920): End of file inside dictionary

gs жалуется:

**** Warning: File has a corrupted %%EOF marker, or garbage after %%EOF.

mupdf жалуется:

+ pdf/pdf_xref.c:60: pdf_read_start_xref(): cannot find startxref
| pdf/pdf_xref.c:477: pdf_load_xref(): cannot read startxref
pdf/pdf_xref.c:532: pdf_open_xref_with_stream(): trying to repair
warning: ignoring invalid character in hex string: '!'
warning: ignoring invalid character in hex string: 'O'
warning: ignoring invalid character in hex string: 'T'
warning: ignoring invalid character in hex string: 'Y'
[....]

qpdf --qdf жалуется:

virkerikke.pdf (object 17 0, file position 2234): null character not allowed in name token

ОК, теперь открываем этот дерьмовый файл в текстовом редакторе, пытаясь его восстановить. Я обнаружил, что этот файл (размером 32746 байтов) имеет серьезные проблемы с синтаксисом:

    Мусор после %%EOF:. После его маркера %%EOF имеется полный и синтаксически правильный HTML файл с надписью «Wkhtmltopdf — Teknisk regelverk». Его размер составляет 11878 байт. Удалите эту часть, и у вас будет «лучший» PDF с размером всего 20868 байтов… хотя Acrobat/Adobe Reader по-прежнему не открывает его после сохранения отредактированного файла.
    Недопустимый символ в токене имени:. Это внутри токена /#8d#c2#ca#ebs#e4#60#00#9e#97l#b9#80#1b#cb#86sQR#83. В этом файле появляется 2x. Уже в моих первых комментариях я сказал вам, что этот ключ для меня не выглядел надежным, потому что он содержит только очень мало символов ASCII, но много двоичных байтов (используя их шестнадцатеричное представление. (Я не обратил внимания на то, что он даже содержал #00, который является представлением PDF для символа nul, использование которого является незаконным для токенов имен в PDF.) Замените этот токен другим (фантазией) с точно такой же длиной (на обоих вхождениях) Я выбрал /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. Сохраните отредактированный файл.

Теперь даже Acrobat/Adobe Readers откроют этот отремонтированный файл без жалоб. Кроме того, «другие читатели» теперь будут работать лучше с этим файлом, выплескивая меньше предупреждений и теперь смогут идентифицировать некоторые метаданные (такие как дата создания и производитель == wkhtmltopdf), которые они не смогли получить для исходного файла.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Отчет об ошибках системы содержание использование информации
  • Отсутствует доступ к файлу запросите разрешение windows 10 как исправить
  • Отчет об ошибках виндовс 10 грузит систему
  • Отсутствует доступ к закрытому ключу для создания подписи как устранить ошибку
  • Отчет об ошибках windows 10 загружает процессор

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии