This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Lauren 5 months, 1 week ago.

Assigned support staff: Lauren.

Author Posts
May 8, 2019 at 2:02 pm

toddM-4

I'm uploading a PDF as a media file in ACF, then displaying it on a page using a PDF viewer hidden link. We pull the PDF viewer into a custom page template which works fine for our main language (English) using this code.

<?php
                                        $pdf = get_field('resource_link', $post->ID);
                                        echo do_shortcode(
                                            '[tnc-pdf-viewer-iframe file="'.$pdf.'" width="1200" height="600" download="true" print="false" fullscreen="true" share="false" zoom="true" open="false" pagenav="true" logo="false" find="false" current_view="false" rotate="true" handtool="true" doc_prop="true" toggle_menu="true" language="en-US" page="" default_zoom="auto" pagemode=""]'
                                        ); ?>

But when we switch to Chinese, the PDF will not load. I have the ACF field 'resource_link' set to copy and also checked 'Duplicate uploaded media to translations' which I'm not sure if that needs to be checked or not.

I do not need two different versions of the PDF to display, I just need the same PDF to display regardless of language.

May 8, 2019 at 3:28 pm
May 9, 2019 at 4:32 pm #3778097

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

I have set up a sandbox site and installed ACF Pro. I added a PDF field, and am displaying the URL on a post page. I have set the field to Copy, and it does show for both languages. Can you please take a look at this staging site? Check the settings and see if you can mimic these settings on your live site, and if it then displays the URL. Feel free to make changes, this site was set up specifically for testing with this issue.

Login: hidden link
Username: demo
Password: fZiw7cH363MV

This is the post page where I uploaded the test PDF:
hidden link

The topic ‘[Closed] PDF not displaying in alternate language’ is closed to new replies.