Support for Microsoft office Publisher files


#1

Hi,

How can I read the Microsoft Office Publisher File with your product? Thanks for your any help.

Thanks,
Dhivya


#2

@Dhivya,

Aspose.PDF API can be used to read Microsoft Office Publisher file. For details please visit the link Aspose.PDF. Feel free to contact us in case of any query or comments.


#3

Hi,

I tried to open the .PUB file using Aspose.PDF for .net version 18.5.0.0, but the PDF object throws exception while loading the file.

Thanks,
Dhivya


#4

@Dhivya,

Please share the sample EPUB file and detailed error message. We will look into it and update you about our findings.


#5

@Dhivya,

Please use EpubLoadOptions class to import EPUB documents as follows:
C#

// Instantiate LoadOption object using EPUB load option
EpubLoadOptions epubload = new EpubLoadOptions();
// Create Document object
Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(dataDir + "EPUBToPDF.epub", epubload); 

If this does not help, then please send us your source EPUB document for the testing purposes. We will investigate your scenario in our environment, and share our findings with you.


#6

Hi,

I tried to get file properties using PdfFileInfo class in Aspose.PDF. But below line of code throwing exception like

“PdfFileInfo is not initialized. Use constructors with parameters or properties for initialization. (File: C:\Users\Dhivya\Desktop\Test Docs\Закон.pub) (Reason: Startxref not found)”

C# code:
PdfFileInfo pdfFileInfo = new PdfFileInfo(@”C:\Users\Dhivya\Desktop\Test Docs\test.pub”);

I tried to create pdf document as per your suggestion, but still getting
“ZipEntry::ReadHeader(): Bad signature (0xE011CFD0) at position 0x00000000”.

EpubLoadOptions opt = new EpudLoadOptions();
Aspose.Pdf.Document = new PdfFileInfo(@”C:\Users\Dhivya\Desktop\Test Docs\test.pub”);

Thanks,
Dhivya


#7

@Dhivya

Thanks for writing back.

You were receiving this error because PdfFileInfo expects PDF document as constructor overload and you were passing an EPUB file.

Please note that, you also need to specify LoadOptions, at the time of document loading as follows:

Aspose.Pdf.Document = new PdfFileInfo(@”C:\Users\Dhivya\Desktop\Test Docs\test.pub”, opt);

However, in case issue still persists, please share your sample input document with us. We will test the scenario in our environment and address it accordingly.


#8

Hi,

I tried to create pdf document as per your suggestion, but still getting
“ZipEntry::ReadHeader(): Bad signature (0xE011CFD0) at position 0x00000000”.

EpubLoadOptions opt = new EpudLoadOptions();
Aspose.Pdf.Document = new PdfFileInfo(@”C:\Users\Dhivya\Desktop\Test Docs\test.pub”, opt);

In previous post missed to add loadoption parameter while sharing with you.

Attached the client file for your testing purpose.
Закон.zip (8.1 KB)

Thanks,
Dhivya


#9

@Dhivya

We were able to replicate the issue while trying to load your shared EPUB document in our environment. Therefore, we have logged this issue as PDFNET-45020 in our issue tracking system. We will further investigate the issue in details and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.


#10

any update on this? i’m also trying to convert .pub file to pdf/word/html/plain text. but not able to convert. above code is giving error. my intention is to extract text from .pub. This i can do, once .pub file is loaded to pdf/html/word, i can extract text from it. But the problem here is I can’t convert .pub to pdf/html/word.

Find attached sample .pub file, do need full.

try
{
EpubLoadOptions opt = new EpubLoadOptions();
var pdfInfo = new PdfFileInfo(path);
// pdfInfo all properties are null.
Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(path, opt);
}
catch (Exception ex)
{
//ERROR : ZipEntry::ReadHeader(): Bad signature (0xE011CFD0) at position 0x00000000
}
sample_pub_file.zip (880.0 KB)


#11

@taqniat

We were able to replicate the issue in our environment and logged two tickets for each file as follows:

  • PDFNET-46913 example.pub
  • PDFNET-46914 example_multipage.pub

We will surely look into details of logged tickets and keep you posted with the status of their correction. Please be patient and spare us little time.

We are sorry for the inconvenience.