Welcome Guest Search | Active Topics | Sign In | Register

PDF created from HTML with no pages Options
edekoning
Posted: Wednesday, August 24, 2022 1:35:54 PM
Rank: Newbie
Groups: Member

Joined: 9/4/2020
Posts: 4
Occasionally HtmlToPdf.ConvertHtml(...) creates a PDF which, when you try to open, reports "This file cannot be opened because it has no pages".
If you had the PDF, could you inspect it and see what might have gone wrong?
eo_support
Posted: Wednesday, August 24, 2022 1:43:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,103
Hi,

The PDF file will just be an empty file and there is no way for us to tell exactly how it got to that point just from that empty file. So we would need to reproduce it first.

You can try the latest build first and see if it resolves the issue for you. If that does not resolve the issue for you, please try to isolate the problem into a test project and send the test project to us. See here for more details:

https://www.essentialobjects.com/forum/test_project.aspx

Once we have that we will debug it here and see what we can find.

Thanks!
edekoning
Posted: Wednesday, August 24, 2022 1:49:31 PM
Rank: Newbie
Groups: Member

Joined: 9/4/2020
Posts: 4
The PDF is not (to my eyes) an empty file. It has:
%PDF-1.4
%ÓôÌá
1 0 obj
<< /Producer (EO.Pdf 21.1.67.0) /Creator (EO.Pdf) >>
endobj
2 0 obj
<< /Type /Catalog
/Pages 3 0 R
/Metadata 4 0 R
/MarkInfo << /Marked true >>
/OutputIntents [
<< /Type /OutputIntent
/S /GTS#5FPDFA1
/OutputConditionIdentifier (sRGB)
/DestOutputProfile 5 0 R
>>
]
>>
endobj
3 0 obj
<< /Type /Pages
/Kids []
/Count 0
>>
endobj
4 0 obj
<< /Type /Metadata
/Subtype /XML
/Length 2272
>>
stream
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreatorTool>EO.Pdf</xmp:CreatorTool>
</rdf:Description>
<rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>application/pdf</dc:format>
<dc:title>
<rdf:Alt>
<rdf:li xml:lang="x-default"></rdf:li>
</rdf:Alt>
</dc:title>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default"></rdf:li>
</rdf:Alt>
</dc:description>
<dc:creator>
<rdf:Seq>
<rdf:li></rdf:li>
</rdf:Seq>
</dc:creator>
<dc:subject>
<rdf:Bag>
<rdf:li></rdf:li>
</rdf:Bag>
</dc:subject>
</rdf:Description>
<rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
<pdf:Keywords></pdf:Keywords>
<pdf:Producer>EO.Pdf 21.1.67.0</pdf:Producer>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>










<?xpacket end="w"?>

endstream
endobj
5 0 obj
<< /N 3 /Length 3144 >>
stream
... binary data ...
endstream
endobj
xref
0 6
0000000000 65535 f
0000000017 00000 n
0000000088 00000 n
0000000355 00000 n
0000000419 00000 n
0000002788 00000 n
trailer
<< /Root 2 0 R
/Info 1 0 R
/ID [<1AD494E8D01E4193F5237974724C1F8E> <1AD494E8D01E4193F5237974724C1F8E>]
/Size 6
>>
startxref
5995
%%EOF
eo_support
Posted: Wednesday, August 24, 2022 1:53:34 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,103
This is a standard empty PDF --- If you look at the " /Type /Pages" part, you will see "/Kids []" and "Count 0". This means the page collection has no "kids", therefore no pages in the PDF file. This is what I meant by an empty PDF file.
edekoning
Posted: Wednesday, August 24, 2022 1:56:40 PM
Rank: Newbie
Groups: Member

Joined: 9/4/2020
Posts: 4
Thanks!
edekoning
Posted: Wednesday, August 24, 2022 2:40:28 PM
Rank: Newbie
Groups: Member

Joined: 9/4/2020
Posts: 4
Even an empty string (as html) produces a 1 page PDF document.
Are you aware of any situation where EO's HtmlToPdf.ConvertHtml() would produce a PDF document with no pages?
Is there any logging one could turn on?

We're on v21.1.67.0

eo_support
Posted: Wednesday, August 24, 2022 9:04:07 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,103
Hi,

No. We are not aware of any situation that can generate an empty file. That's why we are asking a test project.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.