我目前使用Excel來填充表單域的PDF文件。它都可以工作,但是它將它導出爲.xfdf。有誰知道我可以如何將它保存爲PDF?將.xfdf另存爲.pdf
FullFileName = FilePath & "Requisition - " & Trim(MyRecord.CompanyName) & " - " & _
Year & "-" & Month & "-" & Day & "-" & Hour & "-" & Minute & "-" & Seconds & ".xfdf"
Open FullFileName For Output As #1
Print #1, "<?xml version=""1.0"" encoding=""ISO-8859-1""?>"
Print #1, "<xfdf xmlns=""http://ns.adobe.com/xfdf/"" xml:space=""preserve"">"
Print #1, "<fields>"
Print #1, "<field name=""Submitted by""><value>" + Trim(MyRecord.RequestedBy) + "</value></field>"
Print #1, "<field name=""Job Name""><value>" + "Auto Cards" + "</value></field>"
Print #1, "<field name=""Shipping address""><value>" + Trim(MyRecord.StreetNumber) & " " & Trim(MyRecord.StreetName) & ", Unit " & Trim(MyRecord.Suite) & ", " & Trim(MyRecord.City) & ", " & Trim(MyRecord.Province) & ", " & Trim(MyRecord.PostalCode) + "</value></field>"
Print #1, "<field name=""Special Instructions""><value>" + "Print" + "</value></field>"
Print #1, "</fields>"
Print #1, "<f href=""..\Requisition_Fillable.pdf""/>"
Print #1, "</xfdf>"
Close #1 ' Close file.
我對您使用的過程並不熟悉,但我注意到您的文件名以'&「.xfdf」'結尾,因此它會創建一個'.xfdf'文件。不過,我不認爲簡單地將該擴展名改爲.pdf將會創建一個PDF文件。 – FreeMan
我試過這樣做,但是當打開生成的文件時說它已損壞,無法打開。 :\ – santaaimonce
您是否曾想過使用Excel重新創建PDF,將其填入數據中,然後將所有內容保存爲PDF?你必須使用你的pdf模板嗎? –