Posts

Post not yet marked as solved
1 Replies
1.2k Views
When I just open the pdf file, save it and open it with Acrobat Reader, then Acrobat Reader automatically change it. On close action the "Do you want to save the changes you made in the document  ..." dialog box is appeared. This is my sample code: let pdfDocument = PDFDocument(url: URL(fileURLWithPath: "sample.pdf")) if let document = pdfDocument { let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] document.write(toFile: "\(documentsPath)/sample_copy.pdf") } The original sample.pdf document is opened and closed by Acrobat Reader without changes. This problem doesn't occurred with Preview application. Acrobat Reader after opening the sample_copy.pdf added this lines automatically to the end of the document: 1 0 obj^M<</DA(/Helv 0 Tf 0 g )/DR<</Encoding<</PDFDocEncoding 124 0 R>>/Font<</Helv 122 0 R/ZaDb 123 0 R>>>>/Fields[29 0 R 30 0 R 31 0 R 32 0 R 33 0 R 34 0 R]/SigFlags 1>>^Mendobj^M29 0 obj^M<</AP 53 0 R/Border[0 0 0]/DA(/Helvetica 12 Tf 0 g)/F 4/FT/Sig/Ff 0/P 23 0 R/Rect[66.4197 539.1254 122.0197 550.3054]/Subtype/Widget/T(signingDate)/TU(signingDate)/Type/Annot>>^Mendobj^M30 0 obj^M<</AP 50 0 R/Border[0 0 0]/DA(/Helvetica 12 Tf 0 g)/F 4/FT/Sig/Ff 0/P 23 0 R/Rect[246.6142 480.2433 374.2162 538.3054]/Subtype/Widget/T(21948065)/TU(21948065)/Type/Annot>>^Mendobj^M31 0 obj^M<</AP 47 0 R/Border[0 0 0]/DA(/Helvetica 12 Tf 0 g)/F 4/FT/Sig/Ff 0/P 23 0 R/Rect[246.6142 457.2754 536.8462 467.3373]/Subtype/Widget/T(signatureLabel)/TU(signatureLabel)/Type/Annot>>^Mendobj^M32 0 obj^M<</AP 44 0 R/Border[0 0 0]/DA(/Helvetica 12 Tf 0 g)/F 4/FT/Sig/Ff 0/P 23 0 R/Rect[246.6142 447.2133 519.3322 457.2754]/Subtype/Widget/T(identity)/TU(identity)/Type/Annot>>^Mendobj^M33 0 obj^M<</AP 41 0 R/Border[0 0 0]/DA(/Helvetica 12 Tf 0 g)/F 4/FT/Sig/Ff 0/P 23 0 R/Rect[246.6142 435.2133 519.3322 445.2754]/Subtype/Widget/T(advisor)/TU(advisor)/Type/Annot>>^Mendobj^M34 0 obj^M<</AP 38 0 R/Border[0 0 0]/DA(/Helvetica 12 Tf 0 g)/F 4/FT/Sig/Ff 0/P 23 0 R/Rect[246.6142 423.2133 394.2322 433.2754]/Subtype/Widget/T(sapId)/TU(sapId)/Type/Annot>>^Mendobj^M37 0 obj^M<</AcroForm 1 0 R/Metadata 121 0 R/Pages 3 0 R/Type/Catalog>>^Mendobj^M120 0 obj^M<</CreationDate(D:20201027104203Z)/Creator(Quadient Group AG~Inspire~14.0.28.13)/ModDate(D:20201027114213+01'00')/Producer(iOS Version 14.1 \(Build 18A8394\) Quartz PDFContext)>>^Mendobj^M121 0 obj^M<</Length 3206/Subtype/XML/Type/Metadata>>stream^M <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c017 91.164464, 2020/06/15-10:20:05    ">   <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/"       xmlns:pdf="http://ns.adobe.com/pdf/1.3/"       xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"       xmlns:dc="http://purl.org/dc/elements/1.1/">      <xmp:CreateDate>2020-10-27T10:42:03Z</xmp:CreateDate>      <xmp:CreatorTool>Quadient Group AG~Inspire~14.0.28.13</xmp:CreatorTool>      <xmp:ModifyDate>2020-10-27T11:42:13+01:00</xmp:ModifyDate>      <xmp:MetadataDate>2020-10-27T11:42:13+01:00</xmp:MetadataDate>      <pdf:Producer>iOS Version 14.1 (Build 18A8394) Quartz PDFContext</pdf:Producer>      <xmpMM:DocumentID>uuid:64db6ce1-b87c-004d-a9bc-7a66b29b9f29</xmpMM:DocumentID>      <xmpMM:InstanceID>uuid:fa313a45-ffb7-ed4e-b9f8-9916fa4000a5</xmpMM:InstanceID>      <dc:format>application/pdf</dc:format>    </rdf:Description>   </rdf:RDF> </x:xmpmeta> <?xpacket end="w"?>^Mendstream^Mendobj^M122 0 obj^M<</BaseFont/Helvetica/Encoding 124 0 R/Name/Helv/Subtype/Type1/Type/Font>>^Mendobj^M123 0 obj^M<</BaseFont/ZapfDingbats/Name/ZaDb/Subtype/Type1/Type/Font>>^Mendobj^M124 0 obj^M<</Differences[24/breve/caron/circumflex/dotaccent/hungarumlaut/ogonek/ring/tilde 39/quotesingle 96/grave 128/bullet/dagger/daggerdbl/ellipsis/emdash/endash/florin/fraction/guilsinglleft/guilsinglright/minus/perthousand/quotedblbase/quotedblleft/quotedblright/quoteleft/quoteright/quotesinglbase/trademark/fi/fl/Lslash/OE/Scaron/Ydieresis/Zcaron/dotlessi/lslash/oe/scaron/zcaron 160/Euro 164/currency 166/brokenbar 168/dieresis/copyright/ordfeminine 172/logicalnot/.notdef/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu 183/periodcentered/cedilla/onesuperior/ordmasculine 188/onequarter/onehalf/threequarters 192/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]/Type/Encoding>>^Mendobj^Mxref^M 0 2^M 0000000000 65535 f^M 0000051143 00000 n^M 29 6^M 0000051322 00000 n^M 0000051515 00000 n^M 0000051703 00000 n^M 0000051903 00000 n^M 0000052091 00000 n^M 0000052277 00000 n^M 37 1^M 0000052459 00000 n^M 120 5^M 0000052537 00000 n^M 0000052733 00000 n^M 0000056017 00000 n^M 0000056109 00000 n^M 0000056187 00000 n^M trailer^M<</Size 125/Root 37 0 R/Info 120 0 R/ID[<97A42406F7516ED95505948487E1D95D><932412744679411AA23061DADC8C340E>]/Prev 48561>>^Mstartxref^M57380^M%%EOF^M Thanks for helping me :-)
Posted
by berco.
Last updated
.
Post not yet marked as solved
0 Replies
452 Views
I have a Ruby on Rails backend web application. I use iOS application as a web client (WKWebView) written in swift. The authentication token is stored as a session cookies variable on the backend:session['token'] = generate_tokenThe problem is that accidentally this session variable is lost and the flow is redirected to login page. The WKWebView is not closed, just used to process HTTP requests. I'm not able to figure out, why this accidentally happens. It seems like a WKWebView bug, because in Safari this problem has been never happened.
Posted
by berco.
Last updated
.