It sounds like you’re experiencing issues with the footers in your generated PDF document, particularly when viewed in landscape mode. This can occur due to the document’s structure or the footer settings in the original Word document.
Cause: The footer issues may arise from incorrect configurations for landscape orientation or unupdated fields in the document.
Solution: Here are several steps to troubleshoot and resolve the issue:
Check Footer Settings in Word: Open your Word document and ensure that the footer settings are correctly configured for landscape orientation. Adjust footers specifically for different page orientations if necessary.
Update Fields: If your document contains fields (like page numbers or dates), update them before converting to PDF. Select all (Ctrl + A) and then press F9 in Word to refresh the fields.
Use PDF Save Options: When saving the document to PDF, specify options that may help with layout issues. For example, set the PdfSaveOptions to ensure the document structure is preserved correctly.
Here’s a code snippet demonstrating how to use PdfSaveOptions:
import com.aspose.words.Document;
import com.aspose.words.PdfSaveOptions;
import com.aspose.words.SaveFormat;
public class WordToPdf {
public static void main(String[] args) {
try {
String inputFile = "input.docx";
String outputFile = "output.pdf";
Document doc = new Document(inputFile);
PdfSaveOptions options = new PdfSaveOptions();
options.setCompliance(PdfCompliance.PDF_A_1_B); // Example option
doc.save(outputFile, options);
System.out.println("File was converted to PDF: " + outputFile);
} catch (Exception e) {
System.err.println("Error converting: " + e.getMessage());
e.printStackTrace();
}
}
}
Test with Different Versions: If possible, try using a different version of Aspose.Words, as specific versions may have bugs affecting PDF generation.
Check for Updates: Ensure you are using the latest version of Aspose.Words, as updates often include bug fixes and improvements.
Next Steps: If you continue to experience issues, please provide more details about the footer content and any specific formatting you are using. This information will help in diagnosing the problem further.
@stb_ag
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-28595
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.