• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Import from Word not respecting Paper Size
#1
Firstly, I find the interface a little odd in that on the Import menu there isn't an Import... option to open the file browser for an individual file (not a new issue) but you can drag and drop an individual file. 

The PDF import is doing something different than Printing to PDF. I'll attach an example. I am wondering if it is a paper size issue - being British I am in the land of A4. The original file isn't paginated, it relies on a fair wind to not break a stave. Indeed, checking the PDF properties reports a different page size in mm. I also noted the emboldening seems different.

Examples attached. basa(1) is the MobileSheets generated one, (the square brackets seem to be something to do with the forum software being quirky today).


Attached Files
.docx   You Never Can Tell basa.docx (Size: 31.79 KB / Downloads: 5)
.pdf   You_Never_Can_Tell_basa[1].pdf (Size: 66.08 KB / Downloads: 8)
.pdf   You_Never_Can_Tell_basa(1)[1].pdf (Size: 25.88 KB / Downloads: 8)
Reply
#2
I don't really have any control over the conversion from Word to PDF through the PDF library. So there's not too much I can do if it doesn't match perfectly.

Mike
Reply
#3
(11-09-2024, 07:35 PM)Zubersoft Wrote: I don't really have any control over the conversion from Word to PDF through the PDF library. So there's not too much I can do if it doesn't match perfectly.

Mike

Funnily enough, the difference is the other way round to I expected - the document is set to Letter (I've now spotted by tabbing template is wrongly configured after several years!) and the MS print is Letter. The Library print is getting A4 from somewhere else. (If I print to paper, Brother just fits the Letter print onto A4 and doesn't repaginate hence I've not noticed my wrong set up).

So, the Library is apparently not respecting the document size set in the Layout which suggests that the Library is using something other than the document to set the PDF size, which seems like a bug in the library or there is an option getting accidentally overridden somewhere.

It is not a problem to me now I understand what is going on. I've tweaked the thread title to clarify the issue in case others see the issue.

[Edit] It seems to be a design issue in the Library. See DocxPdfRenderOptions() which contains an ominous last line:

Code:
PaperSize
Set an output paper size for PDF pages. System.Drawing.Printing.PaperKind.

Use SetCustomPaperSize(int width, int height) for custom sizes.

Default value is A4.

(https://ironpdf.com/object-reference/api..._PaperSize)
Reply
#4
I don't know word documents have a predefined page size that can be obtained, or if I will have to give the user a way to pick their preferred page size. A global setting would be my preference if the word document doesn't have a page size defined.

Mike
Reply
#5
(11-10-2024, 04:25 PM)Zubersoft Wrote: I don't know word documents have a predefined page size that can be obtained, or if I will have to give the user a way to pick their preferred page size. A global setting would be my preference if the word document doesn't have a page size defined.

Mike

My thought is that the feature was a nice to have (so I am not asking you to spend time on it for me). If it is producing A4 for everyone as it stands, which I guess it must be, then that doesn't seem right as I am sure that will be an issue for your American users at some point. Your workarounds are either to:

1) use a setting as a workaround (seeing as IronPDF doesn't seem to want to use the Word setting), quick and dirty

2) do a load of work to try and surface a document property from Word, remembering that we can always print PDFs and import them anyway so it is not a showstopper.

3) report to IronPDF support as an omission. I can see that, as they are developing IronPDF from a different perspective, thinking about a target page size rather than respecting the source page size might make sense, but they ought to have a setting in that structure for "Use document size". It should be a relatively trivial fix for them as they already have access to the document properties, and it is easy to add a "Document source" to that size parameter.
Reply




Users browsing this thread:
5 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.