I need to convert a PDF file using GHOSTSCRIPT and make it compatible to ISSUU.com
My pdf came from PHP-FPDI output. When I upload it to ISSUU some text/fonts become broken and not visible.
Need to do everything with PHP.
- The pdf is an exisiting PDF. PDF v1.7. When I upload this to ISSUU everything works fine.
I needed to put margin on the exisiting PDF so I used FPDF and FPDI to put a margin.
$pdf = new FPDI; $pdf->AddPage(); $pdf->SetMargins(10,10,10); $pdf->setSourceFile($temp_dir . "/get_" . $row['idml_pages_id'] . ".pdf"); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx, 5, 5, 200, 285, true); $pdf->SetFont('Arial','B',16); $pdf->Output($temp_dir . '/bord_' . $row['idml_pages_id'] . '.pdf' , 'F');
There is now a Margin on the PDF. You can see the exact output here: output PDF Sample
I then upload it to ISSUU and the output becomes like this: ISSUU output . Some of the texts are missing now.
What settings should I use in ghostscript?
- How can I fix this issue?
- I also need Hyperlinks and changing the dCompatibilityLevel to 1.3 will make the hyperlinks not to work.
- I contacted ISSUU and seems no response so I really need to convert using ghostscript.
- Also tried -dCompatibilityLevel 1.7 and it's still same output.
I am using Ghostscript 9.10.
CODE USED:
"C:\Program Files (x86)\gs\gs9.10\bin\gswin32c.exe" -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -sOutputFile=C:/xampp/htdocs/autoepaper/for_upload/1017abord_11599-d14.pdf C:/xampp/htdocs/autoepaper/for_upload/bord_11599.pdf